in

This Blog

Syndication

Advertising

mystyleit

Finding Messages inside Exchange using EntryID

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

Comments

 

Malcom Reynolds said:

Wow, this was really helpful, but confusing at the same time. It was about like reading Greek to me.

www.aofficialpassport.com

October 5, 2010 10:11 PM
 

Wildcard SSL said:

Keep the faith, my Internet friend. You are a first-class writer and deserve to be heard.

December 28, 2010 8:43 AM
 

handbags said:

good article what you post really amazing me thanks for share

November 16, 2011 4:38 AM
 

Cheap WildCard SSL said:

Entire tutorial is so informative, your blog really helping us as technical supporter. Looking for some more blogs on mobile devices.

November 21, 2011 11:28 PM
 

EV SSL Certificates said:

Entire post is so informative, its really helping us i am Looking for your next post

December 27, 2011 7:29 AM
 

QuickSSL Premium said:

Really it’s very good post. Knowledge sharing is the optimum result of knowledge gaining. You are a good reader and also a knowledge seeker .Keep it up.

January 23, 2012 7:09 AM

Leave a Comment

(required)  
(optional)
(required)  
Add

About mike.clarke

Mike is currently a Systems Specialist for a major Canadian software developer and the founder of mystyleit.com.