Hi,
I'm building an application that analyzes Outlook email messages, stores the analyzed information, and later allows the user to open messages meeting certain criteria.
I expected that I would extract the Message-ID from each email, store this in my database, and then ask Outlook to open up a message by providing it with the Message-ID at a later point. However, it would seem that I'm missing something.
Via the Outlook interop APIs, I can get an EntryID, but as far as I can tell, an EntryID is only guaranteed to be stable within a given folder (or maybe a given store). If a message is moved to a different folder, the EntryID may change. Additionally, the APIs require that the StoreID is provided when looking up a message by EntryID. Again, if a message is moved between stores, that information will presumably be invalid.
I've seen plenty of Office-related products that seem to do something like what I've described above. How can I do an efficient look-up of a message that is accessible to Outlook, regardless of stores etc.?
Currently, my back-up plan is to store EntryID and StoreID information for each Message-ID that I scan, and then try all the various EntryID / StoreID combos that I've recorded for a given MessageID until one is successful. But this seems like work that Outlook should already know how to accomplish for me.
Thanks,
-Patrick