Post B2TR Changes for Form Regions

Shortly after we released Outlook 2007 beta 2 technical refresh to the world, we took a change on the Outlook platform to enable a new method of retrieving manifest and icon information for Outlook form regions. The reason for this change was partially due to customer feedback we received during the beta, that add-in developers didn’t like needing to write some files to the disk, while others could be included as resources.

Unfortunately, this change required adding two additional methods to the FormRegionStartup interface defined in the Outlook type library. The end result of this change is that when the final version of Outlook 2007 is released, some solutions that compiled and ran against Outlook 2007 B2TR may need to be updated before they will compile against Outlook 2007 RTM.

While you will need to update any solution that uses form regions in order to compile it against Outlook 2007 RTM, existing solutions that were previously compiled should continue to run successfully on the RTM build even with this change. The additional functions were added to the end of the interface VTable and thus won’t interfere with the existing methods provided in B2TR.

Using the New Methods

The two new methods added in the RTM builds are:

  • public object GetFormRegionManifest(string FormRegionName, int LCID)
  • public object GetFormRegionIcon(string FormRegionname, int LCID, Outlook.OlFormRegionIcon Icon)

GetFormRegionManifest expects a string containing the manifest XML to be the return value. If anything else is provided, the form region will not load.

GetFormRegionIcon can return either a byte-array that represents the original bytes of the image file, or an IPictureDisp object. For more information on how to convert a .NET Image or Bitmap over to IPictureDisp, check out this article on the VSTO blog.

Outlook will only call these methods on the interface if we find a the registry entry that previously was required to point to a file path or include inline XML now contains the ProgID of an add-in installed in Outlook, prefixed with an equal sign (=). For example, if your add-in was named “OutlookAddin1.Connect”, you could write the following value in the registry: “=OutlookAddin1.Connect” and Outlook would then call these functions to request the manifest information for the form region.

These are a few changes worthy of pointing out when using this method:

  • The <name>, <layoutFile>, and <addin> elements of the form region manifest are ignored when provided via GetFormRegionManifest. The form region name is the name of the registry value for the form region, and we already know the ProgID of the add-in.

Child elements of the <icons> element should either be empty elements (like <page/>) or should contain the word “addin” if Outlook should call GetFormRegionIcon for that icon. When the add-in provides the manifest, all icons must be provided via GetFormRegionIcon and cannot be pointers to a file path.

If you have any questions about the behavior of these new methods, please comment on this post. I’d like to make sure that this isn’t a big surprise for anyone working in the form region space when we ship Outlook 2007. I’ll also be updating our form region samples to implement and use this new method when we release the RTM versions of our sample code.

Comments (24)

  1. Martin Parry says:

    There have been some changes to the programming model for Outlook 2007 Form Regions. Full details…

  2. Ryan, when you refer to "a registry entry" above, is that the entry for the form’s message class under the OutlookFormRegions key?

  3. rgregg says:

    I was referring to the OutlookFormRegions<message class> key.

    For instance, if you wanted to use the new mechanism on items of IPM.Note.Foo, you would do this:



  4. Murray says:

    Form Regions look awesome but I’ve only seen mention of C#/VB in relation to them.  Can you only use Form Regions in managed code?  What about Exchange Client extensions that access OOM via IOutlookExtCallback?

  5. rgregg says:


    You can use form regions from any COM add-in, it doesn’t need to be managed code.  You can’t use them via an ECE however.  Solutions that use ECEs should be closely examined in the Outlook 2007 time frame to determine if they can be migrated over to COM add-ins.

  6. Murray says:


    We will be stuck with ECEs for quite some time, we need to support Outlook 2000/2002/2003 as well (2000 will be dropped soon).  Up until know, ECEs where the most flexible, you had access to MAPI and to OOM. So to clarify, even though we can access OOM from our ECE, we can’t use form regions. I’m assuming we could create a COM add-in that communicates to our ECE if necessary.

  7. rgregg says:


    Yes, if you need to continue using ECEs for your particular scenario, then you can certainly create a COM add-in to host form regions, and communicate between your ECE and the COM add-in.

  8. Ken Slovak says:


    If you implement use of these 2 new methods does GetFormRegionStorage still fire? What about BeforeFormRegionShow? In what order do these methods fire?

  9. rgregg says:


    Yes, the two other methods still fire.  The sequence depends on when Outlook fires GetFormRegionManifest, which is fired the first time Outlook "needs" the form region details.  This happens when an item with that message class scrolls into view, or is opened, or the user drops the Actions menu or the New Form dialog.

    The general sequence however will be: GetFormRegionManifest -> GetFormRegionIcon -> GetFormRegionStorage -> BeforeFormRegionShow.

  10. Ken Slovak says:

    Ryan, one other question. I see no way to expand a form region in code or to force it to be not expanded. Is there some way to do that or plans to make IsExpanded read/write in the future or provide some other way of controlling the expansion of a form region?

  11. rgregg says:


    We don’t have any plans to do that in Outlook 2007, although there is polciy around enforcing adjoining regions to be visible.  I feel that the visibility of these reagions is a user preference, and not necessarily something that the solution should be able to force on the user.  However, I’d be interested to hear more about the scenarios where you want to be able to control the state of the adjoining region.

  12. Ken Slovak says:

    Hi Ryan,

    I can see if a form region required large amounts of processing or something that could take some time, such as retrieving data from a Web service, that the programmer might want to always have the form region open not expanded and let the user expand it if they needed access to it. Also, if code provided multiple form regions for different purposes it might be good to have them all not expanded on loading an item until a specific one was needed.


  13. Ken Slovak says:

    Hi Ryan,

    You mention an OlFormRegionIcon enum. Can you provide the enum? It’s not in the current tlb.

    Also, you mention that GetFormRegionIcon receives an Icon paramter. What’s the purpose of passing that parameter to the event handler?



  14. rgregg says:

    The enum OlFormRegionIcon looks like this:

    olFormRegionIconDefault = 1
    olFormRegionIconEncrypted = 9
    olFormRegionIconForwarded = 5
    olFormRegionIconPage = 11
    olFormRegionIconRead = 3
    olFormRegionIconRecurring = 12
    olFormRegionIconReplied = 4
    olFormRegionIconSigned = 8
    olFormRegionIconSubmitted = 7
    olFormRegionIconUnread = 2
    olFormRegionIconUnsent = 6
    olFormRegionIconWindow = 10

    These map directly to the values that can be defined in the form region manifest file.  The method is called once per icon that is listed in the manifest file provided by GetFormRegionManifest.  Outlook will only call for icons that are listed in the manifest, and not for all icon files to save time making useless calls.  The value of the icon parameter in the method tells the add-in which icon is being requested.  This enumeration will be in the RTM type library.

  15. Ken Slovak says:

    Hi Ryan,

    A question about some of the new Olk controls. If I use an OlkBusinessCardControl, OlkContactPhoto, OlkInfoBar or OlkSenderPhoto control (there may be a few others) in a form region, how can I get/set values for those controls? Or can I?

    For example, say I want to add a custom infobar control to a form region. Is there any way I can set the text content of that control? Or set/get the contents of the other controls I listed?



  16. Alex Yakhnin says:

    Hi Ryan,

    I’ve installed the release of the Office 2007 and the form region code that I was developing has stopped working. The RequestService never called for my region GUID. I’ve implemnted the new methods GetFormRegionManifest and GetFormRegionIcon but they never called. Is there anything else that have been changed in the release bits?

  17. rgregg says:

    Ken: Most of the Outlook controls are designed only to replicate the Outlook UI. You need to set the underlying properties on the item to affect the control, or in some cases you cannot modify the display of the control at all.  In particular there is still no way to modify the text displayed on the InfoBar in 2007.

  18. rgregg says:

    Alex: If your solution worked properly in pre-RTM bits of Outlook, it should continue to work in RTM.  Are you using VSTO 2005 SE to develop the add-in?

  19. Hi Ryan, when do you think the samples will be updated? I’m having a real hard time getting this to work on the RTM.

    After returning the manifest as a string in GetFormRegionManifest nothing happens?!? GetFormRegionStorage is never called?!?


  20. Ken Slovak says:

    OK, thanks Ryan. Put that in the request bin then for OL13, the ability to modify values for the controls (along with the ability to expand/contract the form region from code).


  21. Hi Ryan, when do you think the samples will be updated bacuase I have a hard time getting this to work. /Steen

  22. rgregg says:

    I don’t have an ETA on the samples, other than ASAP.  We want to make sure the final version of the samples published for RTM are the highest quality we can provide, and so it’s taking a little bit of extra time to get them out the door.