Finding Messages inside Exchange using EntryID
Recently I have had a need to locate messages inside Exchange using only the EntryID. Ideally I wanted to do this through Outlook but all evidence points towards this not being possible.
The only thing I could find was to use Outlook shortcuts/hyperlinks:
http://www.slipstick.com/outlook/links.htm
But these proved very unreliable. In fact I only managed it make it work once.
Other Possibilities
Based on everything I read, the only way to find the message is through API/SDK. Specifically using GetItemFromID:
http://msdn.microsoft.com/en-us/library/bb219902%28office.12%29.aspx
Solution
My solution was to write a really small C# command line that app that will open the message based on EntryID and StoreID.
The hardest part was getting my Visual Studio app to hook into Outlook 2003/Outlook 2007. The following MSDN articles were very helpful:
Requirements
In order to use this application, you must have the Office Primary Interop Assemblies (PIA) installed for your version of Outlook.
I do not believe that Office 2003 ships with PIA, see Hello Word Outlook Add-In using C# but I believe Office 2007 does.
You can download the PIA for Office 2003 and Office 2007 using the following links:
Here is a link about doing development with PIAs
http://blogs.msdn.com/b/vsto/archive/2008/05/20/common-pitfalls-during-pia-deployment-and-installation.aspx
Results
I ended up making two apps. One for Outlook 2003 and one for Outlook 2007. From the command line I can now open a message using the storeID and entryID. Here is the prototype for app:
When you run the app with the right command line parameters, the app will start Outlook and open the email.
The compiled versions of the app (both Outlook 2003 and Outlook 2007) can be downloaded here:
EntryID.zip
Update: Finding Messages inside Exchange using EntryID
After continue working on this I had problems getting EntryID2003.exe working on Outlook 2003. I believe this is a problem linking into Outlook. Since then I have come up with a new solution in the form of a VB script.
Here is the script
The script can be downloaded here:
EntryIDScript.zip