MAPI Forms Notifications

Applies to: Outlook 2013 | Outlook 2016

Registering for and handling notifications from form objects is a different process than for other MAPI objects. Advise sinks for form notifications implement either the IMAPIViewAdviseSink or IMAPIFormAdviseSink interface rather than IMAPIAdviseSink. IMAPIViewAdviseSink : IUnknown and IMAPIFormAdviseSink : IUnknown each have multiple methods, one for each of the possible events that the corresponding advise source is capable of generating. For example, IMAPIFormAdviseSink has two methods: IMAPIFormAdviseSink::OnChange to handle a change to the form viewer's status and IMAPIFormAdviseSink::OnActivateNext to display a new message with the correct form.

The event handling strategy for forms is similar to the event handling strategy implemented in OLE. Clients do not register for specific event types as they do for most MAPI objects. The assumption is that registering for notification enables them to receive any type of event that can be generated by the particular advise source. Because IMAPIAdviseSink::OnNotify must be written so as to handle all registered events, implementing it can be complex for clients that register for many different events. Because the methods in the form advise sink objects target a single event, implementing these methods is simpler.