Categories

Recent Posts

Archives

Recent Comments

  •  

Links

June 2007


I updated this page with additional Ribbon-style keyboard shortcuts, added to the explanation of how they work and what they look like, and added a link to a page showing how to create and send a message using only the keyboard.
An introduction to Microsoft Office Outlook 2007

I've been noticing some feedback lately where a number of developers were having problems working with the controls on their form region.  Usually, these problems manifested as Outlook's object model returning null values back when trying to access the Controls collection of the UserForm object in the Microsoft Forms 2.0 library (which was accessed from the FormRegion.Form property).

This can be especially frustrating, because it looks like you've done everything right, and Outlook is just giving you back something that is totally wrong. Turns out, that isn't quite the case.

If you've added a reference to the 'Microsoft Forms 2.0' type library, you might have added the wrong reference to your project. On some computers, you'll find two different listings for the forms type library in the Add Reference dialog:

Depending on which reference you select, you'll either get a reference properly associated with the Primary Interop Assembly provided by Office, or you'll get a reference with a Visual Studio generated interop assembly. Unfortuatnely, the VS generated interop assembly incorrectly maps some elements of the type library to elements in the interop assembly.  This ultimately means that when you are using this reference, you'll end up calling into a different property or method than your code appears to be calling, which causes various strange exceptions and errors.

You can easily determine which reference you are using by selecting the reference and looking at the properties of the reference. If you've added the self-generated IA reference, the properties will look like this:

Notice that the reference has "Copy Local" set to True, and that the Path is not pointing at the Global Assembly Cache (GAC) but rather to the location of my solution.  This indicates that I'm using a self-generated interop assembly, and that I may be running into issues.

If you've added the correct reference to the PIA, then you'll see properties that look like this instead:

This time around, you'll see the Path is pointing into the GAC, and the "Copy Local" property is False. This indicates the PIA is being used, and everything should work normally.

If you find your project is using the incorrect reference, you should remove the reference and add a new reference.  Unforutnately, there is no way to determine which reference is the "right" reference from the Add References dialog.  You'll simply need to use trial and error and double check after adding the resource to make sure you've picked the right one.

The Take-away: Make sure you are using the right interop assembly when working with custom forms or form regions from your managed code solution.  Using the Visual Studio generated interop assembly can cause mysterious errors in your solution that you may not catch right away.

Adobe Reader 8.1 allows you to preview PDF attachments in Outlook 2007. Learn how to download, install, and use Adobe Reader to preview PDF attachments.
My favorite general Outlook tips. Sure to improve your life with Microsoft Office Outlook.
Figure out in seconds whether you have Outlook or Outlook Express installed,
Microsoft phasing out Lookout in favor of Windows Desktop Search
I added a table of Ribbon keyboard shortcuts to use when you are editing an Appointment or Meeting Request.
Fixed a typo and added ALT, H, M shortcut to the list.

We've just rolled out the new Outlook team blog, which is the "one-stop-shop for tips, tricks, and rants directly from the Outlook product team."

Don't worry though, my blog won't be going away.  I'll continue to blog about Outlook programmability, custom forms, and other developer-centric parts of Outlook.

Next Page »