-
Notifications
You must be signed in to change notification settings - Fork 63
/
office.attachmentdetails.yml
146 lines (124 loc) · 4.63 KB
/
office.attachmentdetails.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
### YamlMime:TSType
name: Office.AttachmentDetails
uid: 'outlook!Office.AttachmentDetails:interface'
package: outlook!
fullName: Office.AttachmentDetails
summary: |-
Represents an attachment on an item from the server. Read mode only.
An array of `AttachmentDetails` objects is returned as the attachments property of an appointment or message item.
remarks: >-
\[ [API set: Mailbox 1.1](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets) \]
**[Minimum permission
level](https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions)<!-- -->**:
**read item**
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!-- -->**:
Read
#### Examples
```TypeScript
// The following code builds an HTML string with details
// of all attachments on the current item.
const item = Office.context.mailbox.item;
let outputString = "";
if (item.attachments.length > 0) {
for (let i = 0 ; i < item.attachments.length ; i++) {
const attachment = item.attachments[i];
outputString += "<BR>" + i + ". Name: ";
outputString += attachment.name;
outputString += "<BR>ID: " + attachment.id;
outputString += "<BR>contentType: " + attachment.contentType;
outputString += "<BR>size: " + attachment.size;
outputString += "<BR>attachmentType: " + attachment.attachmentType;
outputString += "<BR>isInline: " + attachment.isInline;
}
}
console.log(outputString);
```
isPreview: false
isDeprecated: false
type: interface
properties:
- name: attachmentType
uid: 'outlook!Office.AttachmentDetails#attachmentType:member'
package: outlook!
fullName: attachmentType
summary: Gets a value that indicates the type of an attachment.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'attachmentType: MailboxEnums.AttachmentType | string;'
return:
type: '<xref uid="outlook!Office.MailboxEnums.AttachmentType:enum" /> | string'
- name: contentType
uid: 'outlook!Office.AttachmentDetails#contentType:member'
package: outlook!
fullName: contentType
summary: >-
Gets the MIME content type of the attachment.
**Warning**: While the `contentType` value is a direct lookup of the attachment's extension, the internal
mapping isn't actively maintained so this property has been deprecated. If you require specific types, grab the
attachment's extension and process accordingly. For details, refer to the [related blog
post](https://devblogs.microsoft.com/microsoft365dev/outlook-javascript-api-deprecation-for-attachmentdetails-contenttype-property/)<!--
-->.
remarks: ''
isPreview: false
isDeprecated: true
customDeprecatedMessage: 'If you require specific content types, grab the attachment''s extension and process accordingly.'
syntax:
content: 'contentType: string;'
return:
type: string
- name: id
uid: 'outlook!Office.AttachmentDetails#id:member'
package: outlook!
fullName: id
summary: >-
Gets the Exchange attachment ID of the attachment. However, if the attachment type is
`MailboxEnums.AttachmentType.Cloud`<!-- -->, then a URL for the file is returned.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'id: string;'
return:
type: string
- name: isInline
uid: 'outlook!Office.AttachmentDetails#isInline:member'
package: outlook!
fullName: isInline
summary: Gets a value that indicates whether the attachment should be displayed in the body of the item.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'isInline: boolean;'
return:
type: boolean
- name: name
uid: 'outlook!Office.AttachmentDetails#name:member'
package: outlook!
fullName: name
summary: >-
Gets the name of the attachment.
**Important**: For message or appointment items that were attached by drag-and-drop or "Attach Item", `name`
includes a file extension in Outlook on Mac, but excludes the extension on the web or on Windows.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'name: string;'
return:
type: string
- name: size
uid: 'outlook!Office.AttachmentDetails#size:member'
package: outlook!
fullName: size
summary: Gets the size of the attachment in bytes.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'size: number;'
return:
type: number