Office.Entities interface

Warning

This API is now deprecated.

Use regular expression rules instead.

Represents a collection of entities found in an email message or appointment. Read mode only.

The Entities object is a container for the entity arrays returned by the getEntities and getEntitiesByType methods when the item (either an email message or an appointment) contains one or more entities that have been found by the server. You can use these entities in your code to provide additional context information to the viewer, such as a map to an address found in the item, or to open a dialer for a phone number found in the item.

If no entities of the type specified in the property are present in the item, the property associated with that entity is null. For example, if a message contains a street address and a phone number, the addresses property and phoneNumbers property would contain information, and the other properties would be null.

To be recognized as an address, the string must contain a United States postal address that has at least a subset of the elements of a street number, street name, city, state, and zip code.

To be recognized as a phone number, the string must contain a North American phone number format.

Entity recognition relies on natural language recognition that is based on machine learning of large amounts of data. The recognition of an entity is non-deterministic and success sometimes relies on the particular context in the item.

When the property arrays are returned by the getEntitiesByType method, only the property for the specified entity contains data; all other properties are null.

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.

Remarks

Minimum permission level: read item

Applicable Outlook mode: Read

Properties

addresses

Gets the physical addresses (street or mailing addresses) found in an email message or appointment.

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.

contacts

Gets the contacts found in an email address or appointment.

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.

emailAddresses

Gets the email addresses found in an email message or appointment.

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.

meetingSuggestions

Gets the meeting suggestions found in an email message.

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.

phoneNumbers

Gets the phone numbers found in an email message or appointment.

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.

taskSuggestions

Gets the task suggestions found in an email message or appointment.

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.

urls

Gets the Internet URLs present in an email message or appointment.

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.

Property Details

addresses

Warning

This API is now deprecated.

Use regular expression rules instead.

Gets the physical addresses (street or mailing addresses) found in an email message or appointment.

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.

addresses: string[];

Property Value

string[]

Examples

const item = Office.context.mailbox.item;
const addresses = item.getEntitiesByType(Office.MailboxEnums.EntityType.Address);

contacts

Warning

This API is now deprecated.

Use regular expression rules instead.

Gets the contacts found in an email address or appointment.

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.

contacts: Contact[];

Property Value

Examples

const item = Office.context.mailbox.item;
const contacts = item.getEntitiesByType(Office.MailboxEnums.EntityType.Contact);

emailAddresses

Warning

This API is now deprecated.

Use regular expression rules instead.

Gets the email addresses found in an email message or appointment.

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.

emailAddresses: string[];

Property Value

string[]

Examples

const item = Office.context.mailbox.item;
const emailAddresses = item.getEntitiesByType(Office.MailboxEnums.EntityType.EmailAddress);

meetingSuggestions

Warning

This API is now deprecated.

Use regular expression rules instead.

Gets the meeting suggestions found in an email message.

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.

meetingSuggestions: MeetingSuggestion[];

Property Value

Examples

const item = Office.context.mailbox.item;
const meetingSuggestions = item.getEntitiesByType(Office.MailboxEnums.EntityType.MeetingSuggestion);

phoneNumbers

Warning

This API is now deprecated.

Use regular expression rules instead.

Gets the phone numbers found in an email message or appointment.

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.

phoneNumbers: PhoneNumber[];

Property Value

Examples

const item = Office.context.mailbox.item;
const phoneNumbers = item.getEntitiesByType(Office.MailboxEnums.EntityType.PhoneNumber);

taskSuggestions

Warning

This API is now deprecated.

Use regular expression rules instead.

Gets the task suggestions found in an email message or appointment.

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.

taskSuggestions: string[];

Property Value

string[]

Examples

const item = Office.context.mailbox.item;
const taskSuggestions = item.getEntitiesByType(Office.MailboxEnums.EntityType.TaskSuggestion);

urls

Warning

This API is now deprecated.

Use regular expression rules instead.

Gets the Internet URLs present in an email message or appointment.

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.

urls: string[];

Property Value

string[]

Examples

const item = Office.context.mailbox.item;
const urls = item.getEntitiesByType(Office.MailboxEnums.EntityType.Url);