Updated Samples for Outlook 2007 Developers


Last week we uploaded revised versions of our sample code for Outlook 2007 add-ins.  The biggest change to these samples is that they are now provided as both a shared add-in project and VSTO 2005 SE project, so that you can see how add-in development would work using either technology.

These samples should give you a good basis for working with form regions, custom task panes, rules, the Table and PropertyAccessor objects, Ribbon extensibility and context menu customization.

You can download the latest samples from the following links:

Comments (7)

  1. Sean Burns says:

    Hi Ryan,

    Great samples, however the Travel Agency sample doesn’t seem to match the MSDN article in the area of custom form regions.  The screen shot in the article shows the Itineraries List in the style of something like a ListView control, with columns, headings, etc.  However the sample has a simple listbox control with string items.

    My question is this: Are new Custom Form Regions restricted to the set of Outlook Forms or Windows 2.0 Form controls?  I’d like a ListView or even better a WebBrowser control for my Itineraries/whatever list.

    If we are limited to Outlook Forms Controls, how was the style in the article achieved?

    Cheers,

    Sean

  2. Sean Burns says:

    [Apologies if this is a double post]

    The Itineraries Form Region list is a simple olkListBox which, in the samples, is filled with string items.  This does not match the MSDN article where the screen shot shows a list which looks more like a WinForms ListView or similar, i.e with columns, headings, etc.

    Can you use WinForms controls like ListView, or even better WebBrowser, in Outlook Form Regions?  If not, how was the screen shot List Style achieved?

    Cheers,

    Sean

  3. rgregg says:

    Hi Sean,

    You’re right, we changed the code after the screenshot for the article was made.  To be clear, you aren’t limited to using just OUtlook Form Controls or Forms 2.0 controls.  You can use any ActiveX control in a form region and it should just work.  However, you cannot at this time use managed code controls or UserControls, even if you expose them as COMVisible(true).  The COM wrapper generated by the framework does not support all the interfaces to allow our forms surface to work properly with the control.

    For the original screenshot, I used the Microsoft ListView control, which is available as an ActiveX control.  After I had the same up and working, we decided to remove it and switch it back to a standard list box.  The code to workwith the ListView ActiveX control in managed code was rather significant, and we decided we should try to keep the sample clean.

    You can certainly use the WebBrowser ActiveX control on a form region, we have a few internal samples that work with that control and it works great.

  4. gokhan says:

    hi!

    I’m creating outlook 2007 mobile service. i was write to code. and i using this refenace http://msdn2.microsoft.com/en-us/library/bb277361.aspx

    outlook is send tihs message to inbox "Outlook did not receive response from the Web service because of a problem connecting to the server. Try again later." when i send SMS.

    so i see this error when i add account and click "test account" button. please help me! where i was do wrong.

    thanks all!

  5. dans says:

    When I installed the application, the detected dependencies for the TravelAgencyAddinCSSetup were disabled and referenced a path to the GAC that I was not able to change. How can I change the path? Do you have a copy that doesn’t depend on your local development machine configuration?

  6. rgregg says:

    Dans,

    It sounds like you may not have the Office 2007 PIAs installed on your dev machine.  Was the .NET Framework instaled when you installed Office 2007?

    The other thing you can do is delete the references to the PIAs, and then add them back.  To add the Outlook reference, click Add References, then select COM, and then find the library for Microsoft Outlook 12.0.  For travel agency, you also need to add fm20.dll, which should be listed under the COM reference tab as "Microsoft Forms 2.0".

  7. Stephen says:

    Hi Ryan,

    I am having trouble with the PrepareMeVB_VSTO solution, it seems to be throwing an exception when trying to build the treeview, it is ok in the CS version. Here is the tract from the immediate window:

    Inspectors_NewInspector

    A first chance exception of type ‘System.InvalidCastException’ occurred in PrepareMeVB_VSTO.DLL

    Ribbon_OnLoad

    PrepareMeGroup_GetVisible

    PrepareMe_GetPressed

    Any pointers?

    Thanks