'What is EntryID in Outlook?
I'm working on a Outlook VSTO Addin that will plug-into the iManage FileSite AddIn, I'm currently trying to access the currently selected folders ID (Within the DMS) and I noticed that the CurrentFolder.EntryID property contains a very large Hexidecimal string, which when converted to UTF-16 looks like a malformed ObjectID for iManage. See below (Some info is redacted):
�"�j���'`�W�vp441!nrtdms:0:!session:REDACTED:!database:TEC:!page:440:??!nrtdms:0:!session:REDACTED:!database:TEC:!publicpagescontainer??!nrtdms:0:!session:REDACTED:!database:TEC:??!nrtdms:0:!session:REDACTED:!explorercontainer??!nrtdms:0:!session:REDACTED:??!nrtmsg:neighborhood:??!nrtmsg:root:
I have been working on some regex to separate the Folder ID from the rest of the string but I can't help but think there's a more stable method.
Anyone have any ideas?
Solution 1:[1]
The ENTRYID identifier structure is described in MSDN. The ENTRYID
structure is used by message store and address book providers to construct unique identifiers for their objects.
Members
abFlags - Bitmask of flags that provide information that describes the object. Only the first byte of the flags, abFlags[0], may be set by the provider; the other three are reserved. These flags must not be set for permanent entry identifiers; they are only set for short-term entry identifiers. To clients, this structure is read-only. The following flags can be set in abFlags[0]:
- MAPI_NOTRECIP - The entry identifier cannot be used as a recipient on a message.
- MAPI_NOTRESERVED - Other users cannot access the entry identifier.
- MAPI_NOW - The entry identifier cannot be used at other times.
- MAPI_SHORTTERM - The entry identifier is short-term. All other values in this byte must be set unless other uses of the entry identifier are enabled.
- MAPI_THISSESSION - The entry identifier cannot be used on other sessions.
ab - Indicates an array of binary data that is used by service providers. The client application cannot use this array.
You can convert the string to a binary data using the PropertyAccessor.StringToBinary method which converts a string specified by Value to an array of bytes. For more information on type conversion when using the PropertyAccessor
object, see Best Practices for Getting and Setting Properties.
Solution 2:[2]
In addition to the answer by @Eugene Astafiev, the format of some entry ids is documented. It is fairly easy to parse the PST, Exchange, and GAL entry ids.
Take a look at the entry ids with MFCMAPI or OutlookSpy (I am its author). Here is what OutlookSpy shows for a message PR_ENTRYID
in a cached Exchange store (click IMessage button, select the PR_ENTRYID property):
abFlags[0]: 00
abFlags[1]: 00
abFlags[2]: 00
abFlags[3]: 00
muid: 5E81754F003E1549B0659F2AEA92E7C2 ({4F75815E-3E00-4915-B065-9F2AEA92E7C2})
Type: 0x0007 (eitLTPrivateMessage)
FolderDatabaseGUID: C7CF2304C77BF64585E8892DD6FF7BAC ({0423CFC7-7BC7-45F6-85E8-892DD6FF7BAC})
FolderGlobalCounter: 0xCAA69A1A0000
Pad1: 0x0000
MessageDatabaseGUID: 4A7CE85ED1AB274C9E20AA3CBFA828B1 ({5EE87C4A-ABD1-4C27-9E20-AA3CBFA828B1})
MessageGlobalCounter: 0x70A650D90100
Pad2: 0x0000
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Eugene Astafiev |
Solution 2 |