-
Notifications
You must be signed in to change notification settings - Fork 63
/
office.contact.yml
247 lines (193 loc) · 9.89 KB
/
office.contact.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
### YamlMime:TSType
name: Office.Contact
uid: 'outlook!Office.Contact:interface'
package: outlook!
fullName: Office.Contact
summary: >-
Represents the details about a contact (similar to what's on a physical contact or business card) extracted from the
item's body. Read mode only.
The list of contacts extracted from the body of an email message or appointment is returned in the `contacts` property
of the [Entities](xref:outlook!Office.Entities:interface) object returned by the `getEntities` or `getEntitiesByType`
method of the current item.
**Warning**: Entity-based contextual Outlook add-ins are now retired. However, regular expression rules are still
supported. We recommend updating your contextual add-in to use regular expression rules as an alternative solution.
For guidance on how to implement these rules, see [Contextual Outlook
add-ins](https://learn.microsoft.com/office/dev/add-ins/outlook/contextual-outlook-add-ins)<!-- -->.
remarks: >-
**[Minimum permission
level](https://learn.microsoft.com/office/dev/add-ins/outlook/understanding-outlook-add-in-permissions)<!-- -->**:
**restricted**
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!-- -->**:
Read
**Important**: Entity-based contextual Outlook add-ins will be retired in Q2 of 2024. The work to retire this
feature will start in May and continue until the end of June. After June, contextual add-ins will no longer be able to
detect entities in mail items to perform tasks on them. The following APIs will also be retired.
- `Office.context.mailbox.item.getEntities` - `Office.context.mailbox.item.getEntitiesByType` -
`Office.context.mailbox.item.getFilteredEntitiesByName` - `Office.context.mailbox.item.getSelectedEntities`
To help minimize potential disruptions, the following will still be supported after entity-based contextual add-ins
are retired.
- An alternative implementation of the **Join Meeting** button, which is activated by online meeting add-ins, is
being developed. Once support for entity-based contextual add-ins ends, online meeting add-ins will automatically
transition to the alternative implementation to activate the **Join Meeting** button.
- Regular expression rules will continue to be supported after entity-based contextual add-ins are retired. We
recommend updating your contextual add-in to use regular expression rules as an alternative solution. For guidance on
how to implement these rules, see [Contextual Outlook
add-ins](https://learn.microsoft.com/office/dev/add-ins/outlook/contextual-outlook-add-ins)<!-- -->.
For more information, see [Retirement of entity-based contextual Outlook
add-ins](https://devblogs.microsoft.com/microsoft365dev/retirement-of-entity-based-contextual-outlook-add-ins)<!--
-->.
#### Examples
```TypeScript
const item = Office.context.mailbox.item;
// Get an array of strings that represent contacts in the current item's body.
const contacts = item.getEntitiesByType(Office.MailboxEnums.EntityType.Contact);
console.log("There are " + contacts.length + " contacts.")
contacts.forEach(function (contact) {
console.log("Person name: " + JSON.stringify(contact.personName));
console.log("Business name: " + JSON.stringify(contact.businessName));
console.log("Addresses: " + JSON.stringify(contact.addresses));
console.log("Phone numbers: " + JSON.stringify(contact.phoneNumbers));
console.log("Email addresses: " + JSON.stringify(contact.emailAddresses));
console.log("Urls: " + JSON.stringify(contact.urls));
});
/* Example email that includes contact details of sender, John Smith:
Hi there,
I have received the package.
Thanks.
John Smith
Account Manager
Contoso Corporation
1 Contoso Way, Redmond, WA 98052
john.smith@contoso.com
111-111-1111
https://contoso.com/john.smith
*/
```
isPreview: false
isDeprecated: true
customDeprecatedMessage: >-
Use [regular expression rules](https://learn.microsoft.com/office/dev/add-ins/outlook/contextual-outlook-add-ins)
instead.
type: interface
properties:
- name: addresses
uid: 'outlook!Office.Contact#addresses:member'
package: outlook!
fullName: addresses
summary: >-
An array of strings containing the mailing and street addresses associated with the contact. Nullable.
**Warning**: Entity-based contextual Outlook add-ins are now retired. However, regular expression rules are
still supported. We recommend updating your contextual add-in to use regular expression rules as an alternative
solution. For guidance on how to implement these rules, see [Contextual Outlook
add-ins](https://learn.microsoft.com/office/dev/add-ins/outlook/contextual-outlook-add-ins)<!-- -->.
remarks: ''
isPreview: false
isDeprecated: true
customDeprecatedMessage: >-
Use [regular expression rules](https://learn.microsoft.com/office/dev/add-ins/outlook/contextual-outlook-add-ins)
instead.
syntax:
content: 'addresses: string[];'
return:
type: 'string[]'
- name: businessName
uid: 'outlook!Office.Contact#businessName:member'
package: outlook!
fullName: businessName
summary: >-
A string containing the name of the business associated with the contact. Nullable.
**Warning**: Entity-based contextual Outlook add-ins are now retired. However, regular expression rules are
still supported. We recommend updating your contextual add-in to use regular expression rules as an alternative
solution. For guidance on how to implement these rules, see [Contextual Outlook
add-ins](https://learn.microsoft.com/office/dev/add-ins/outlook/contextual-outlook-add-ins)<!-- -->.
remarks: ''
isPreview: false
isDeprecated: true
customDeprecatedMessage: >-
Use [regular expression rules](https://learn.microsoft.com/office/dev/add-ins/outlook/contextual-outlook-add-ins)
instead.
syntax:
content: 'businessName: string;'
return:
type: string
- name: emailAddresses
uid: 'outlook!Office.Contact#emailAddresses:member'
package: outlook!
fullName: emailAddresses
summary: >-
An array of strings containing the SMTP email addresses associated with the contact. Nullable.
**Warning**: Entity-based contextual Outlook add-ins are now retired. However, regular expression rules are
still supported. We recommend updating your contextual add-in to use regular expression rules as an alternative
solution. For guidance on how to implement these rules, see [Contextual Outlook
add-ins](https://learn.microsoft.com/office/dev/add-ins/outlook/contextual-outlook-add-ins)<!-- -->.
remarks: ''
isPreview: false
isDeprecated: true
customDeprecatedMessage: >-
Use [regular expression rules](https://learn.microsoft.com/office/dev/add-ins/outlook/contextual-outlook-add-ins)
instead.
syntax:
content: 'emailAddresses: string[];'
return:
type: 'string[]'
- name: personName
uid: 'outlook!Office.Contact#personName:member'
package: outlook!
fullName: personName
summary: >-
A string containing the name of the person associated with the contact. Nullable.
**Warning**: Entity-based contextual Outlook add-ins are now retired. However, regular expression rules are
still supported. We recommend updating your contextual add-in to use regular expression rules as an alternative
solution. For guidance on how to implement these rules, see [Contextual Outlook
add-ins](https://learn.microsoft.com/office/dev/add-ins/outlook/contextual-outlook-add-ins)<!-- -->.
remarks: ''
isPreview: false
isDeprecated: true
customDeprecatedMessage: >-
Use [regular expression rules](https://learn.microsoft.com/office/dev/add-ins/outlook/contextual-outlook-add-ins)
instead.
syntax:
content: 'personName: string;'
return:
type: string
- name: phoneNumbers
uid: 'outlook!Office.Contact#phoneNumbers:member'
package: outlook!
fullName: phoneNumbers
summary: >-
An array containing a `PhoneNumber` object for each phone number associated with the contact. Nullable.
**Warning**: Entity-based contextual Outlook add-ins are now retired. However, regular expression rules are
still supported. We recommend updating your contextual add-in to use regular expression rules as an alternative
solution. For guidance on how to implement these rules, see [Contextual Outlook
add-ins](https://learn.microsoft.com/office/dev/add-ins/outlook/contextual-outlook-add-ins)<!-- -->.
remarks: ''
isPreview: false
isDeprecated: true
customDeprecatedMessage: >-
Use [regular expression rules](https://learn.microsoft.com/office/dev/add-ins/outlook/contextual-outlook-add-ins)
instead.
syntax:
content: 'phoneNumbers: PhoneNumber[];'
return:
type: '<xref uid="outlook!Office.PhoneNumber:interface" />[]'
- name: urls
uid: 'outlook!Office.Contact#urls:member'
package: outlook!
fullName: urls
summary: >-
An array of strings containing the Internet URLs associated with the contact. Nullable.
**Warning**: Entity-based contextual Outlook add-ins are now retired. However, regular expression rules are
still supported. We recommend updating your contextual add-in to use regular expression rules as an alternative
solution. For guidance on how to implement these rules, see [Contextual Outlook
add-ins](https://learn.microsoft.com/office/dev/add-ins/outlook/contextual-outlook-add-ins)<!-- -->.
remarks: ''
isPreview: false
isDeprecated: true
customDeprecatedMessage: >-
Use [regular expression rules](https://learn.microsoft.com/office/dev/add-ins/outlook/contextual-outlook-add-ins)
instead.
syntax:
content: 'urls: string[];'
return:
type: 'string[]'