Picking an API

Angela just posted an article on extending Outlook on her blog, and an article on picking the right API on the MSDN. Both articles make several mentions of MFCMAPI and are thus worthwhile reads. The MSDN article is an especially good one-stop overview of all the APIs and technologies available in Outlook, with special attention…


Updating Recipients From Outlook Add-Ins

Suppose you had an Exchange Client Extension in which you hooked events such as IExchExtMessageEvents::OnCheckNames. From this event, you’d get an IExchExtCallBack interface from which you could use the functions GetRecipients and SetRecipients to modify the recipient collection. Now suppose you’re trying to convert this code to an Outlook Add-In so you can work with…


Migrating ECE to AddIn

In Outlook 2007 and prior, a common pattern for solutions written using Exchange Client Extensions (ECE) involved intercepting when Outlook would open a message, so that the contents of the message could be modified. This technique was used in several solutions, from virus scanning to implementing e-mail archiving. The events available in ECEs made these…


Can’t Open A Stream Twice

A customer asked me to document this, as they had run in to it while developing a COM Add-in for Outlook. They were trying to do some work with attachments, and this led them to listen to the Outlook Object Model’s BeforeAttachmentAdd event. Inside this event, they used MAPIOBJECT to get the attachment, and called…


HrProcessConvActionForSentItem

[This is now documented here: http://msdn.microsoft.com/en-us/library/ff976788.aspx] If you’re like me, you spend your time using Depends to see what kinds of new and exciting functions are exported every time there’s a new release of Outlook. Ok – so I don’t really do that, but development did ask me to document one of those functions. Here…


You Dirty Rat

[This is now documented here: http://msdn.microsoft.com/en-us/library/gg262878.aspx ] Another in the series of APIs Development asked me to document. This time, it’s a property you can request via IDispatch to ask if an item is dirty or not. Same as last time, I didn’t test this code, so I’d appreciate feedback. dispidFDirty This property is used…


No Photos Please

[This is now documented here: http://msdn.microsoft.com/en-us/library/gg508913.aspx ] [This API no longer functions in Outlook 2013 – it is Outlook 2010 only] Development recently asked that I document a few oddball Outlook APIs. Here’s the first – a way to turn the Sender Contact Photo feature on or off in a particular inspector or explorer window….


Remote Typelibs and the Outlook Object Model

As I’ve mentioned before, I don’t like to install Office on my build servers. Neither do some of my customers, one of whom reported that they couldn’t get their Outlook 2010 based object model code to compile on their build servers. The problem they reported was in their #import statements. They looked something like this:…


Outlook 2010 Managed Code Examples

In honor of Outlook 2010 being released to manufacturing last week, Angela posted an article discussing the new Outlook 2010 PIA reference. It covers a wide variety of common tasks, from dealing with multiple Exchange accounts to the new conversation view. This is a great place to start if you’re writing Outlook solutions using managed…


PR_SEARCH_KEY and Draft Messages

It used to be that if you wanted to track a message through various Object Model events such as NewInspector and ItemSend, one way to do it was to grab PR_SEARCH_KEY. A customer recently discovered that this doesn’t always work after applying a recent hotfix. Before applying the hotfix, PR_SEARCH_KEY would remain unchanged during the…