Binding custom forms to Outlook Explorer
and Inspector windows in .NET: C#, VB
Add-in Express™ Extensions
Binding custom forms to Outlook windows
This page shows how you use Add-in Express Extensions for Outlook to bind your custom forms to Outlook windows.
To embed your custom form into Outlook windows, you add a new item to the Items collection of the Outlook Forms Manager and bind it to your form's class and the Outlook Explorer or / and Inspector window via special properties of the added item. All properties of items of the Outlook Forms Manager's Items collection are described below.
Please note that with one item of the Items collection you can embed your custom form into the Outlook Explorer and Inspector windows simultaneously.
Binding .NET forms to Outlook folders
Remember that your custom form is bound to Outlook folders by an item of the Items collection of the Outlook Forms Manager. In addition, the Add-in Express Extensions for Outlook allows you to bind one form to several Outlook folders through several items of this collection. For example:
What can you need it for? Using different items for binding the same form to Outlook folders you can create logical sets to control the form's behavior, to change bound folders, etc. For example, you can disable or enable your forms separately for all mail folders or for the "Personal Folders\Special" folder. Also, you can change a form's layout to place your form on the top folder view region for mail folders and on the bottom folder view region for the "Personal Folders\Special" folder. Another purpose is to replace the form class name. It gives you a possibility to dynamically and flexibly bind different forms to different folders.
How can you bind your forms to Outlook folders? First of all, you can do it via the Items collection designer of the Outlook Forms Manager, as shown above. If you need to do it by code (on-the-fly), you should handle the ADXBeforeFolderSwitch event of the Outlook Forms Manager and create new items, delete existing items, enable/disable them, bind to other folders, etc. In general, only in the handler of ADXBeforeFolderSwitch you can change the Items collection of the Outlook Forms Manager.