Customize Outlook 2010, 2013 folder views
with .net forms (WinForms): C#, VB.NET

Add-in Express™ Extensions
for Microsoft® Outlook®

Customize Outlook folder view (Explorer window)

With the Add-in Express Advanced Regions you can create a custom Outlook view programmatically by embedding feature-rich .NET forms, or WinForms, into the most recent version of Outlook 2013 as well as all previous versions of Outlook 2010 down to 2000.

Your own .NET forms can be embedded into one, several or all types of Outlook folder views (Explorer windows) and forms (Inspector windows).

Create custom Outlook views with Advanced Regions

In the Microsoft terms, the Outlook view (folder pane) is the area where items (messages, tasks, notes, etc.) of the selected folder are shown. The Extensions allows you to replace the folder pane of the selected Outlook folder with your custom view regions.

Custom Outlook view region with 3 embedded .NET forms

Also, the Extensions helps you embed your WinForm into a specific region of a selected folder, see a custom Outlook 2010 view with 4 .NET forms added to the Reading Pane area.

Custom view region for a selected folder in Outlook 2010

The most often preferred layout - placing your region in the right part of the Explorer window of Outlook 2013, 2010 and 2007:

Custom Outlook view region embedded into the right part of the Explorer window

Advanced Regions support embedding multiple forms into multiple regions (top, bottom, left or right). Below you can see a step-by-step instruction on how to embed your WinForms into an Outlook view. We have also a number of videos showing how create an Outlook custom view and form:

1. Add the Outlook Forms Manager to the add-in module

The Extensions adds to the add-in module commands set a special command, "Add Outlook Forms Manager", available on the command area of the Properties window or by right-clicking the add-in module. To include the Add-in Express Extensions functionality in your add-in project you just run this command. The command adds the Outlook Forms Manager component to the add-in module and makes some changes in the add-in setup project.

Adding the Outlook Forms Manager

The Outlook Forms Manager (ADXOlFormsManager) is very important because it centralizes all your forms and binds them to Outlook folders. The component provides several Outlook-specific properties and events such as:

  • AddinModule. Returns a reference to the add-in module that contains the Outlook Forms Manager component.
  • The Items collection. Each item of this collection binds one form class to its own folder set. To embed the form into regions for every folder view, its class should be specified for one or more items that bind the form's instances to appropriate folders through ExplorerItemTypes, FolderName and FolderNames properties.
  • CurrentForm. Returns a reference to the form's instance if it exists in the current region of the current Outlook Explorer window / view. Returns null if no form instances exist in the current Outlook view.
  • OutlookAppObj. Returns a reference to the Outlook.Application object that hosts your add-in.
  • ADXBeforeFolderSwitch. Occurs before the Explorer window goes to a new folder, either as a result of a user action or through the program code. You can use this event to finish all active processes in the current form embedded into the current Outlook region.
  • ADXNewInspector. Occurs whenever a new inspector window is opened, either as a result of user action or through program code.

2. Create and customize a new Outlook form

The Add-in Express Extensions provides a special template, ADX Outlook Form, used for creating custom forms which are to be embedded into Outlook views. The ADX Outlook Form template is available via the Add New Item dialog of the add-in project:

Creating a custom Outlook form

On the created form you can use any controls and components including data grids, list views, edit and combo boxes, etc.

Custom Outlook form

In addition to all properties and events of System.Windows.Forms.Form, ADX Outlook Form (the ADXOlForm class) provides several Outlook-specific properties and events such as:

  • ExplorerObj. Returns a reference to the current Outlook Explorer object.
  • FolderItemsObj. Returns a reference to the Items collection of the current folder.
  • FolderObj. Returns a reference to the current folder object.
  • OutlookAppObj. Returns a reference to the Outlook.Application object that hosts your add-in.
  • FormsManager. Returns a reference to the Outlook Forms Manager component that controls the form.
  • Item. Returns a reference to the item of the Items collection of the Outlook Forms Manager component that controls the form.
  • ADXBeforeFormShow and ADXAfterFormShow. Occur each time before / after the form is shown.
  • ADXSelectionChange. Retranslates the Outlook.SelectionChange event to the form. For example, you can use this event to react to selection changes when the user switches to a different item in a folder using the user interface.

3. Bind your form to Outlook folders

To specify the folders for which your form is displayed, you add a new item to the Items collection of the Outlook Forms Manager, select your form class in the FormClassName property and specify the folder via three special properties: FolderName, FoldersNames and ExplorerItemTypes. These properties are common for all Outlook-related components provided by Add-in Express.

Then, with the ExplorerLayout property you specify the view region that the form is placed on:

Binding your custom form to Outlook folders

4. Run your add-in

Run your add-in and select one of the specified folders. You will see your custom Outlook view region on the Reading Pane:

Custom Outlook view region displays on the Reading Pane for a specific folder

See also how to create custom Outlook forms for To-Do bar, Navigation and Reading pane.

Have any questions? Ask us right now!