Tom Carver
Tom Carver

Reputation: 1018

How to access EWS `UniqueId` field in Outlook plugin

We have a VSTO Outlook plugin using the .net Interop wrapper (v15) that adds additional metadata to emails, which we then pull into our primary application via EWS. We identify emails in our application with the EmailMessage.Id.UniqueId field. New functionality requires our Outlook plugin to be able to match the email currently open to the record in our application, ideally without completely re-architecting the way we identify emails in our application :) Is there any way to access the EWS UniqueId field in Outlook? I can see the _MailItem.ConversationID and _MailItem.EntryID fields but even after converting hex strings -> base64 they don't match (and are the wrong length). Googling this I've found references to a ConvertId function but this seems to be EWS functionality, I need something within Outlook I can call.

Upvotes: 0

Views: 158

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66215

You can convert between PR_ENTRYID (exposed through MailItem.EntryID in OOM) and EWS id using the ConvertId operation - see https://learn.microsoft.com/en-us/exchange/client-developer/web-service-reference/convertid-operation

Upvotes: 1

Related Questions