Form Regions in VSTO Orcas, binding to Outlook data fields
Hi all,
In the VSTO SE scheme, when I design a form region in Outlook 2007 I can bind the controls to the underlying data that the inspector is showing, be they Outlook "built-ins" or custom fields I've added to the item and /or folder.
I'm wondering how I do the same with the VSTO Orcas Beta 1? I'm able to create a form region, and put all sorts of .Net controls on it, and have them show up when I run Outlook, and I'm wondering how I can automatically bind Outlook controls to the underlying data?
I tried creating a group in the Toolbox and putting all the Outlook controls in it (from the COM tab), but I'm not allowed to drop any of them onto the form region; I get a popup error dialog with the following:
Failed to create component 'AxHost'. The error message follows:
'System.Runtime.InteropServices.COMException(0x80040154): Class not registered (Exception from HRESULT: 0x80040154
with a stack trace.
As a second question, is there any way or plans to allow for the import of already created form regions (via the .ofs files)?
Fred Hommel
If I understood the discussion, we'll be able to import existing .ofs files, and if the Outlook 2007 controls are on the form region, the importer will make the glue logic behind the scenes to bind the controls to the data in the store?
But if I heard correctly, we'll have to choose between having other activex objects on the form region vs. using the Outlook controls?
Currently, I can drop in an excel spreadsheet, for instance, and have Outlook controls bound to the underlying IPM item - this won't be possible anymore using VSTO?
Fred
This is a new/additional way to create form regions using VSTO, no functionality is being removed. You will still be able to create form regions based on WinForms controls (but still with no automatic data binding to Outlook fields).
In the new way to create form regions, you will design your OFS file in Outlook as you can do today (any control is fair game as long as it is supported by Outlook).You then will import that control into your Outlook Add-in, we will automatically generate a form region class (whose base class is a new type being introduced in Beta 2 that is not a Windows Form Control) . We will generate members in this new class for every control in your OFS so you can now easily write manage code.
Just to clarify, you will be able to generate Form Region based on a Windows Forms control (as you can in Beta 1) and now create form regions based on an OFS file (which allows the use of the olk* controls and any other control Outlook allows in an OFS). For the time being, there will be no way to mix-n-match Windows forms controls and olk control in the same form region.
I hope this clarifies a little bit more what to expect from the new feature.
Thank-you Daniel.
Its not the most ideal solution, but it will allow us to deliver solutions.
Dare I ask what the BCM folks used for thier form regions? Did they have to write a lot of code they aren't willing to share? 
They seem to have a good mix'n'match of fields bound to Outlook data and thier own custom logic, on the same form region.
Fred