Contextual Outlook add-ins

Contextual add-ins are Outlook add-ins that activate based on text in a message or appointment. By using contextual add-ins, a user can initiate tasks related to a message without leaving the message itself, which results in an easier and richer user experience.

The following are examples of contextual add-ins:

  • Choosing an address to open a map of the location.
  • Choosing a string that opens a meeting suggestion add-in.
  • Choosing a phone number to add to your contacts.

How to make a contextual add-in

A contextual add-in's manifest must include an ExtensionPoint element with an xsi:type attribute set to DetectedEntity. Within the ExtensionPoint element, the addin specifies the entities or regular expression that can activate it. If specifying an entity, the entity can be any of the properties in the Entities object. Thus, the add-in manifest must contain a rule of type ItemHasKnownEntity or ItemHasRegularExpressionMatch. The following example shows how to specify an entity that is a phone number:

<Rule xsi:type="ItemHasKnownEntity" EntityType="PhoneNumber" Highlight="all" />

After a contextual add-in is associated with an account, it will automatically start when the user clicks a highlighted entity or regular expression. For more information on regular expressions for Outlook add-ins, see Use regular expression activation rules to show an Outlook add-in.

There are several restrictions on contextual add-ins:

  • A contextual add-in can only exist in read add-ins (not compose add-ins).
  • You cannot specify the color of the highlighted entity.
  • An entity that is not highlighted will not launch a contextual add-in in a card.

Because an entity or regular expression that is not highlighted will not launch a contextual add-in, add-ins must include at least one Rule element with the Highlight attribute set to all.

Note: The EmailAddress and Url entity types do not support highlighting, so they cannot be used to launch a contextual add-in. They can however be combined in a RuleCollection rule type as an additional activation criteria.

How to launch a contextual add-in

A user launches a contextual add-in through text, either a known entity or a developer's regular expression. Typically, a user identifies a contextual add-in because the entity is highlighted. The following example shows how highlighting appears in a message. Here the entity (an address) is colored blue and underlined with a dotted blue line. A user launches the contextual add-in by clicking the highlighted entity.

Example of text with highlighted entity (an address)

Shows the highlighted entity within an email

When there are multiple entities or contextual add-ins in a message, there are a few user interaction rules:

  • If there are multiple entities, the user has to click a different entity to launch the add-in for it.
  • If an entity activates multiple add-ins, each add-in opens a new tab. The user switches between tabs to change between add-ins. For example, a name and address might trigger a phone add-in and a map.
  • If a single string contains multiple entities that activate multiple add-ins, the entire string is highlighted, and clicking the string shows all add-ins relevant to the string on separate tabs. For example, a string that describes a proposed meeting at a restaurant might activate the Suggested Meeting add-in and a restaurant rating add-in.

How a contextual add-in displays

An activated contextual add-in appears in a card, which is a separate window near the entity. The card will normally appear below the entity and centered with respect to the entity as much as possible. If there is not enough room below the entity, the card is placed above it. The following screenshot shows the highlighted entity, and below it, an activated add-in (Bing Maps) in a card.

Example of an add-in displayed in a card

Shows a contextual app in a card

To close the card and end the add-in, a user clicks anywhere outside of the card.

Current contextual add-ins

The following contextual add-ins are installed by default for users with Outlook add-ins:

  • Bing Maps
  • Suggested Meetings

Additional Resources

->
" tab appears as white text with a blue background. If a new add-in is selected, the tab will change to blue text with a white background.

  • Additional add-in tabs, if any, would appear in a tab to the right of "Bing Maps" with blue text and a white background. When a user clicks any tab, it changes to white text with a blue background, and the new add-in loads.

  • Clicking the "+ Get more add-ins" button opens the Office Store.

  • If the add-in name is too large for the available space, it is replaced with "..." that is to the left of the "+ Get more add-ins". The user can then click that to see a dropdown list of the add-ins that wouldn't fit into the bar.

  • To close the card and end the add-in, a user clicks anywhere outside of the card.

  • The following screenshot shows how the same add-in (in this case Bing Maps) would appear in the bar if the text couldn't be highlighted (for example, if it was contained in a hyperlink).

    Example of an add-in bar and an add-in in an iframe

    Shows the app bar above the iframe displaying the app

    Note the following:

    • In this screenshot, the add-in bar shows the name of the launched add-in and the "+ Get more add-ins" above the iframe. If there are any other add-ins (contextual or not) that launch from the add-in bar, they would also appear.

    • The iframe displays the add-in. The developer can set the height of the iframe, but the width is a fixed value. The same height is used for the add-in bar add-in as for the card; the developer doesn't need to specify two separate heights.

    How contextual add-ins appear on different devices

    On a desktop computer, a contextual add-in typically displays in a card; if there are multiple add-ins, they appear on separate tabs. On tablets, the same add-in displays in an overleaf and, if there are multiple add-ins, they appear in tabs. On phones, the add-in displays as an immersive experience. In the case where there are multiple add-ins that have activated on the entity, a "..." is visible in the top right to let users navigate between the different add-ins on the specific entity.

    Current contextual add-ins

    The following contextual add-ins are installed by default for users with Outlook add-ins:

    • Bing Maps

    • Suggested Meetings

    Also, the Package Tracker contextual add-in is available from the Office Store.

    Additional Resources