Handling MAPI forms
Applies to: Outlook 2013 | Outlook 2016
A MAPI form is a viewer for a message of a particular class. Clients that allow their users to work with messages belonging to a variety of message classes must be written to handle a variety of MAPI forms. To handle multiple forms, clients implement a component known as a form viewer which contains the following three objects:
A message site object, which supports the IMAPIMessageSite : IUnknown interface.
A view advise sink, which supports the IMAPIViewAdviseSink : IUnknown interface.
A view context object, which supports the IMAPIViewContext : IUnknown interface.
Each of these objects is used by a component called the form server which implements each form, handling its storage and the notifications generated by clients handling the view. One other component, the form library provider, implements a form manager. The form manager administers the form libraries, which store form server executable files. This administration includes loading the appropriate form server and handling the initial communication between the server and the client.
The following diagram shows the relationship between a client and the other parts of the MAPI form architecture.
MAPI form architecture
If your client plans to handle MAPI forms, you will use the form manager's IMAPIFormMgr : IUnknown interface to perform five basic tasks:
Launch the appropriate MAPI form server when a message is opened or composed.
Display form servers' icons in the contents tables of folders.
Send and receive form notifications. For more information, see Sending and Receiving Form Notifications.
Allow users to install or remove form servers from form libraries. For more information, see Maintaining a Form Library.
Allow users to associate form servers with particular folders.
To access the form manager, call the MAPIOpenFormMgr function once during initialization.
In this section
Implementing a Form Viewer: Describes how to implement a form viewer by using a view advise sink, a message site, and a view context.
Implementing Standard Form Verbs: Describes how to implement the verbs for user menu or button clicks on MAPI forms.
Sending and Receiving Form Notifications: Describes how to send and receive form notifications.
Maintaining a Form Library: Describes how to maintain a library that holds all the important information about a form.
Loading a Message Into a Form: Describes how to load a message into a form.
Composing a New Message by Using a Form: Describes how to compose a message using a form.
Displaying Form Icons: Describes the steps for displaying an icon with a form.