Create custom Outlook folder view
(Outlook Explorer window) in VB.NET, C#, Chrome

Add-in Express™ Extensions
for Microsoft® Outlook®

Add-in Express Home >

Customize Outlook folder view (Explorer window)

The Add-in Express Extensions for Microsoft Outlook is a visual tool for advanced customization of Outlook 2007 - 2000 forms and views. It is based on the Windows API and comprised of over twenty internal classes. But all the internal classes were designed to provide only two public components. This makes Add-in Express Extensions for Outlook easy-to-use in accordance with the true RAD paradigm. So, the Extensions for Outlook provides a very comfortable way to enhance the GUI of your Outlook add-ins with minimal service coding. You write your application code only.

Below you can see step-by-step instructions on how to quickly start customizing Outlook folder views (Explorer window) with Advanced Folder View Regions provided by the Add-in Express Extensions for Outlook. Visual Studio .NET 2003 and 2005 (Visual Basic .NET, C#) are supported. Before we start you may want to read more about Outlook web view regions. See also a video showing how to customize views in Outlook Today 2007 style.

See the most recent video samples on Add-in Express blog:

1. Add the Outlook Forms Manager

The Add-in Express Extensions for Outlook 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.

Adding Outlook Forms Manager

To include the Extensions for Outlook functionality in your Outlook add-in project, open the project, select the add-in module and run the "Add Outlook Forms Manager" command. The command adds the Outlook Forms Manager component to the add-in module.

Adding Outlook Forms Manager

2. Add a new embedded form

Then, run the "ADX Outlook Form" wizard from the Add New Item dialog of the Outlook add-in project. The wizard adds a new form module to the add-in project.

Embedding a new Outlook form

3. Customize your Outlook form

On your form, you can use any .NET controls such as calendars, edit boxes, grids, list views, etc. In this example we added a label to show the date when the selected message was sent.

Customizing the Outlook form

4. Access Outlook objects

ADXOlForm provides access to the base Outlook objects and events. For example, you can handle the ADXSelectionChange event to synchronize your form with selection changes in the current Explorer window:

C#


private void ADXOlForm1_ADXSelectionChange() {
        Outlook._Application OlApp
                = this.OutlookAppObj as Outlook._Application;
        Outlook.Selection Selection = OlApp.ActiveExplorer().Selection;
        if (Selection.Count != 0)
        {
                Outlook.MailItem item = Selection[1] as Outlook.MailItem;
                SentLabel.Text = "Sent: " + item.SentOn;
        }
}

VB.NET


Private Sub ADXOlForm1_ADXSelectionChange() Handles Me.ADXSelectionChange

        Dim OlApp As Outlook._Application = CType(OutlookAppObj, Outlook._Application)
        Dim Selection As Outlook.Selection = OlApp.ActiveExplorer().Selection
        Dim Item As Outlook.MailItem

        If Selection.Count <> 0 Then
                Item = CType(Selection(1), Outlook.MailItem)
                SentLabel.Text = "Sent: " + Item.SentOn
        End If
End Sub

5. Bind the form to Outlook folders and folder views

To specify the folders which your form is displayed for, 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 Outlook folder using three special properties, FolderName, FoldersNames and ExplorerItemTypes, that are common for all Outlook-related classes provided by Add-in Express. Then, with the ExplorerLayout property, you specify the region (folder view or web-view region) that the form is placed on: WebViewPane replaces the content of the Explorer window with a web view region and RightSubpane, TopSubpane or BottomSubpane create corresponding folder view region.

Binding the form to Outlook folders

6. Run your Outlook add-in

Finally, you rebuild the add-in project, run Outlook and find your form embedded into the folder view region.

Running your new Outlook add-in

That's it! See also how Advanced Outlook Regions provided by Add-in Express can help you with customization of Outlook 2007 forms, Navigation Pane & To-Do Bar.