Review of the Outlook 2010 Object Model

The release of Outlook 2007 was a gift from the gods for Outlook developers. The number of new objects, properties and methods represented a nearly 50% increase in the size of the Outlook Object Model (OOM).  Kudos have to go to Outlook Program Managers Randy Byrne (former Outlook MVP) and Ryan Gregg for their hard work in implementing these changes, and they deserve recognition as well for their patience over the years of listening to our constant feedback (and occasional begging).

The usual “What’s New In The Outlook 200x Object Model” article on MSDN hasn’t been published yet, so I took another look through the OOM to see what has changed.  I’ve spent about two hours in a lab at Microsoft’s campus in Redmond playing with Outlook 2010  – first in the spring of 2008 and again this spring.  The Outlook team were present both times with clipboards in hand taking notes on our comments, criticisms and kudos.  I’m happy to say that at least one request I seem to recall making has made it in – more on that later – but let’s get on with the review…

The mysterious PickerDialog object…

What’s this – Outlook.Application.PickerDialog?  Not sure, but it seems interesting.  We’ve already had PickFolder, ShowCategoriesDialog and SelectNamesDialog objects to play with since OL 2007.  PickerDialog is implemented as a generic Object, but another search shows the full interface in Microsoft.Office.Core.PickerDialog.  The interface exposes PickerFields, PickerProperties and PickerResults, so it looks very useful.  However, this might be an object that is only fully realized in other Office applications and not Outlook itself (much like the Microsoft.Office.Core.FileDialog object), so we’ll have to see what the intentions for its use will be.  I’m hoping that it can be used to display a dialog to pick an e-mail in Outlook.  Yes, you can build a custom form and use the Outlook View Control, but it would be nice if this was a full OOM resident.

Support for selecting!

Finally – we have control over selecting items in the currently active folder! I specifically remember asking for this, possibly even before Outlook 2007 was released.  My argument was you could be designing a solution that requires action on the items that a user indicates.  The only recourse in the past has been to design your own form with listbox or grid controls – but you’d have to traverse a rather broad Items collection (or search results) in order to present the pool of messages from which to select – AND decide on which of the gazillion Item properties to expose in your controls in order to at least make it look like your design fits in the Outlook GUI.  I’ve used the XtraGrid control from DevExpress to make these kinds of forms look very professional, and am planning a future post on the wonders of the Outlook style controls in this suite.

Anyway, building your own selector is usually not easy.  So here are the new methods for working with item selections via the Explorer object:

  • ClearSelection
  • IsItemSelectableInView
  • RemoveFromSelection
  • SelectAllItems

There’s also the ability to finally determine the date and time that’s selected in a Calendar.  This is NOT the date/time of an appointment item, but a blank block of time that you may want to choose to create a new appointment in. This is exposed via the CalendarView.SelectedEndTime and CalendarView.SelectedStartTime properties.  What I’ve had to do in the past to detect the selected date/time was to automate clicking the New button in the toolbar (while in a Calendar folder) to create a new “dummy” AppointmentItem object.  This will cause the End and Start property values to default to what’s currently selected in the Calendar. Then you can close the item if you want when you’re done with it if you don’t need to do anything “real” with the item (although the item’s window will flash briefly as it opens and closes so this is kind of a hack).

Furthermore, selecting will now also work with the To-Do bar, such as with Task List entries.

Custom icons!

A lot of people will be happy for this change – the ability to implement your own custom icons for folders.  This is done via the Folder.GetCustomIcon and Folder.SetCustomIcon methods. These icons are implemented via the stdole.Picture interface.

Let’s talk about Conversations…

Outlook 2010 is big on the whole conversation experience – more on that here.  So to support this, there’s now a whole new Conversation object that can be retrieved by any Item’s GetConversation method.  That way we no longer have to use Restrict, Find or AdvancedSearch to find items with the same ConversationTopic.

So far so good

There’s a lot more in the OOM that I need to pore through, so perhaps another post is coming that will detail anything else I find interesting.  I haven’t talked about the new extensibility capabilities with the Outspace object or the new support for Solutions Modules yet, so perhaps I will cover that later.

Eric Legault

Full-stack product builder & consultant for Microsoft 365 & Graph. Microsoft MVP 2003 - 2019. Outlook add-in guru. Rocker. Video/audio engineer. Collects Thors.

You may also like...

%d bloggers like this: