Introduction
The management of form regions within Microsoft Outlook represents a significant capability for developers and organizations seeking to customize the user interface for specific business workflows, data collection, or informational display. Form regions allow for the integration of custom controls and data presentation directly into standard Outlook forms, such as email messages, calendar items, or tasks. The core of this customization lies in the precise configuration of the form region's behavior and location, which is dictated by settings within the form region's manifest XML file. This document provides a comprehensive overview of the methods for specifying the location of a form region within a custom Outlook form, drawing exclusively from the provided technical documentation. The guidance covers strategies for adding form regions to the default page, creating separate pages, replacing entire form pages, and replacing the complete standard form, all of which are controlled by the formRegionType and displayAfter elements within the XML schema.
Understanding Form Regions and Their Manifest
A form region in Outlook is a modular component that extends the functionality of a standard form. It is defined by an XML manifest file that specifies its internal name, user interface layout, and, critically, its placement within the form hierarchy. The placement is controlled by two primary elements in the manifest XML file: formRegionType and displayAfter.
The formRegionType element determines the fundamental relationship between the form region and the parent form. Its value dictates whether the form region is appended to an existing page, inserted as a new page, or serves as a replacement for an existing form component. The displayAfter element is used to establish a sequential order when multiple form regions are added to a form, specifying which form region should precede another.
The registration of a form region is completed in the Windows Registry. Under either the local machine key (HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Outlook\FormRegions) or the current user key (HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\FormRegions), a key must be created for the message class the form region will handle (e.g., IPM.Note). Within that key, a value of type REG_SZ is added, where the name of the value is the internal name of the form region and the data is the full local file path to the form region's manifest XML file. This registration process links the form region to its intended application within Outlook.
Adding Form Regions to the Default Page
One common method for integrating a form region is to add it to the default page of a standard form, such as the body of an email message. This is achieved by specifying adjoining as the value of the formRegionType element in the form region's manifest XML file. When configured this way, the form region is appended to the bottom of the default page and is displayed in both the Inspector window (when the item is opened) and the Reading Pane (when the item is selected in the list).
For example, to add a single form region to the bottom of the default page of the standard Message form, the following line would be included in the form region's manifest XML file:
<formRegionType>adjoining</formRegionType>
This configuration is suitable for displaying supplementary information or controls that are contextually related to the main content of the item but do not require a separate page.
Adding Multiple Form Regions to the Default Page
When multiple form regions need to be added to the same default page, a specific order must be established. For each form region, the formRegionType is set to adjoining. However, to control their vertical sequence, the displayAfter element is used for all form regions except the one intended to be first.
The displayAfter element specifies the internal name of the form region that should appear immediately before the current one. The first form region in the sequence does not require a displayAfter element, as it will be positioned at the top of the appended section. Subsequent form regions are placed in the order dictated by their displayAfter values.
It is important to note that this initial order is only valid the first time the form is displayed for a user on a local computer. Users have the option to change the order of adjoining form regions by opening the form and using the form region header context menu to move them up or down. Outlook caches this user-modified order and uses it for all subsequent displays of the form on that computer.
Adding Form Regions as Separate Pages
For more substantial customizations, form regions can be added as entirely separate pages within the standard form. This approach is ideal when the custom content is distinct from the default page and warrants its own tabbed interface.
To add a form region as a separate page, the formRegionType element is set to separate. The first form region designated as a separate page is added directly to the standard form as a new page. Additional separate pages are added sequentially based on the displayAfter element.
For instance, to create an ordered sequence of three separate pages named A, B, and C with internal names FormRegionA, FormRegionB, and FormRegionC, the configuration would be as follows:
* In the manifest for FormRegionA: <formRegionType>separate</formRegionType> (no displayAfter element).
* In the manifest for FormRegionB: <formRegionType>separate</formRegionType> and <displayAfter>FormRegionA</displayAfter>.
* In the manifest for FormRegionC: <formRegionType>separate</formRegionType> and <displayAfter>FormRegionB</displayAfter>.
The resulting custom form will display these as distinct pages in the order A, B, and C.
Replacing the Entire Default Page
In scenarios where the default page of a standard form is to be completely substituted with a custom interface, the formRegionType can be set to replace. This action replaces only the default page of the original standard form; any other existing pages or separate form regions within the standard form are removed.
When registering a form region configured for replacement, a derived message class must be used. For example, if creating a form region to replace the default page of a message with a derived class IPM.Note.CustomPage, the registry key would be created under the appropriate key (e.g., HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\FormRegions\IPM.Note.CustomPage). The value name would be the internal name of the form region (e.g., CustomPage), and the data would be the full path to its manifest XML file (e.g., c:\Form Regions\CustomPage.xml).
The resulting custom form is then used exclusively to display items of the derived message class (IPM.Note.CustomPage in this example), not the original standard message class.
Replacing the Entire Standard Form
The most comprehensive customization involves replacing the entire standard form with a single form region. This is specified by setting the formRegionType element to replaceall. In this configuration, the standard form serves only as a template, and the custom form consists solely of the form region as its default page. Any other form pages or separate form regions from the original standard form are discarded.
Similar to the page replacement scenario, a derived message class is mandatory for registration. The registry key is created for the derived message class, and the value is set with the internal name and file path of the form region.
For example, a form region with the internal name CustomMessage and manifest file CustomMessage.xml located at c:\Form Regions would be registered under a derived message class key, such as HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\FormRegions\IPM.Note.CustomMessage. The custom form would then be used to display items of the IPM.Note.CustomMessage class, presenting only the custom form region interface.
Conclusion
The strategic placement of form regions in Outlook is a powerful feature for tailoring the application to specific organizational needs. The choice between adjoining to the default page, creating separate pages, or replacing existing components is determined by the formRegionType setting (adjoining, separate, replace, or replaceall) within the form region's manifest XML file. The displayAfter element provides essential control over the sequence of multiple form regions. Successful implementation requires careful configuration of the XML manifest and precise registration in the Windows Registry, always linking the form region to a specific message class. This technical framework enables developers to create highly customized and efficient user experiences within the Outlook environment.