Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Activate a mail add-in for a specific message class

Activate a mail add-in in Outlook for a specific message class

Office Add-ins

Identify the message class of an item in Outlook and activate a mail add-in based on the message class of the currently viewed item.

Last modified: August 07, 2015

Applies to: apps for Office | Office Add-ins | Outlook

Learn more about supported hosts and other requirements.

Note Note

The name "apps for Office" is changing to "Office Add-ins". During the transition, the documentation and the UI of some Office host applications and Visual Studio tools might still use the term "apps for Office". For details, see New name for apps for Office and SharePoint.

In this article
What is a message class?
Activating mail add-ins based on the message class
Additional resources

Each item in Outlook is associated with a message class. One primary purpose of the message class is to identify the form that Outlook should use to display the item. For example, an email message has the message class IPM.Note. Outlook uses the Message form to display an item with this message class.

Outlook supports customizing standard forms. For example, you can add a page to the standard Appointment form to display the business address of the contact in an online map. This custom Contact form has a custom message class. The name of the custom message class extends the Appointment message class IPM.Appointment (for example, IPM.Appointment.MyForm). The Outlook form designer and the Outlook COM-based object model support customizing a standard form and creating a custom message class based on the corresponding built-in message class.

You can design a mail add-in to be activated when the user is viewing an item of a specific message class. Note that this does not apply when the user is composing an item.

A service that works with items of a specific message class can enhance its functionality by implementing a mail add-in that activates based on a specific message class. The supported message classes are the built-in message classes for messages (IPM.Note) and appointments (IPM.Appointment), and any custom message classes inheriting from IPM.Note or IPM.Appointment.

For example, an online tutoring service can schedule lesson times as Outlook appointments for subscribers. These appointments inherit from the IPM.Appointment built-in message class, and can have a custom message class such as IPM.Appointment.Contoso. Without using a mail add-in, every time when an appointment occurs, the online tutoring service would require a subscriber to go to their website to view the lesson. To better integrate the customer experience, the service can create a Contoso Appointment mail add-in that activates only when the user is viewing an appointment that has that custom message class. After a subscriber installs the Contoso Appointment mail add-in in Outlook, whenever the subscriber views one of these Contoso appointments, the ItemIs rule verifies that the appointment message class (IPM.Appointment.Contoso) is equal to the specified ItemClass attribute, and the mail add-in activates. The user chooses the add-in in the add-in bar, the add-in opens a viewer for the online lesson in the add-in pane, and the subscriber can start the lesson without leaving Outlook.

The key to identifying the message class of an item and activating the mail add-in lies in an activation rule of the ItemIs type. The ItemIs activation rule has a required ItemType attribute in which you specify a supported type of item, and an optional ItemClass attribute in which you specify the message class or custom message class for which you would like the mail add-in to activate. You should set the required FormType attribute to the Read type of form that the mail add-in activates in. There is one more attribute which is optional, IncludeSubClasses, in which you can specify that the add-in should activate for all message classes that inherit the message class specified in the ItemClass attribute. The following table lists the supported values for ItemType and the corresponding ItemClass message classes.






Includes email messages, meeting requests, responses, and cancellations. The following are the corresponding message classes:







The following XML code shows an example of an activation rule that activates a mail add-in if the user is viewing an appointment that has the custom message class IPM.Appointment.Contoso.

<Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Read" ItemClass="IPM.Appointment.Contoso"/>

The following activation rule example activates a mail add-in if the user is viewing an appointment that has the custom message class IPM.Appointment.Contoso, or any other message class that starts with IPM.Appointment.Contoso, such as IPM.Appointment.Contoso.Lab and IPM.Appointment.Contoso.Exam.

<Rule xsi:type="ItemIs" ItemType="Appointment" FormType="Read" ItemClass="IPM.Appointment.Contoso" IncludeSubClasses="true" />
© 2015 Microsoft