If you want to implement drag and drop support from Microsoft Outlook to your application, there are already some good resources out there.
These only describe how you can get the temporary .msg-File Outlook creates in a temporary folder. If you want information about the original Outlook message (like EntryID, StoreID, etc.), you can find a solution here!
In the process of building our Outlook addin, we came across this problem, as we need to identify the message in Outlook. There are some workarounds using the current Outlook selection, but we thought there might be another way!
It turns out, there is. Outlook also provides some formats called "RenPrivateMessages", "RenPrivateLatestMessages" etc. You can view all of that data using ClipSpy, which we also used to reverse engineere this stuff. You can find an example WPF project in this repository.
Note: This was only tested in Outlook 2013 yet, 2010 will be next.
It's actually a quite simple format, even though there are some bytes missing, the most interesting stuff is easy to get. Once you get the byte stream of "RenPrivateMessages", it can be read using the following parser:
Length in Bytes | Type | Value |
---|---|---|
4 Bytes | int (possibly uint) | FolderId length |
Length given by previous value | binary | The MAPI ParentFolderId of the item |
4 Bytes | int | StoreId length |
Length given by previous value | binary | The MAPI StoreId of the item |
4 Byte | ?? | Unknown |
4 Byte | ?? | Unknown |
4 Byte | ?? | Unknown, but seems to be folder dependent |
4 Byte | int | Number of Items |
Loop for itemCount | --- | --- |
4 Byte | int | Represent the MAPI property 0x8014 ("SideEffects" in OlSpy) |
1 Byte | byte | Length of MessageClass |
Length given by previous value | ASCII | The MessageClass (e.g. IPM.Task) of the item |
1 Byte | byte | Number of Unicode chars of Subject |
Number of Unicode chars * 2 | Unicode | The subject of the item |
4 Bytes | int | EntryId length |
Length given by previous value | binary | The MAPI EntryId of the item |
4 Bytes | int | SearchKey length |
Length given by previous value | binary | The MAPI SearchKey of the item |
4 Bytes | ?? | Unknown, seems to be always E0 80 E9 5A |
4 Bytes | int | Length of unknown property - usually 00-00-00-00 |
Length given by previous value | binary | Length given by previous value |
Outlook 2013: 20 Bytes Outlook 2010: 16 bytes Outlook 2007: 12 bytes |
?? | Most of the time all 0-bytes, but the 1st: O2013: 1st byte is often 0x08 or 0x09 O2010: 1st byte is often 0x18 or 0x08 O2007: 1st byte is often 0x01 |
Next item | --- | --- |