Skip to content

reverse engineered Outlook drag and drop (clipboard) OLE protocol

License

Notifications You must be signed in to change notification settings

yasoonOfficial/outlook-dndprotocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reverse Engineered Outlook Drag and Drop (Clipboard) OLE Protocol

Introduction

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.

The Format

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 BytesTypeValue
4 Bytesint (possibly uint)FolderId length
Length given by previous valuebinaryThe MAPI ParentFolderId of the item
4 BytesintStoreId length
Length given by previous valuebinaryThe MAPI StoreId of the item
4 Byte??Unknown
4 Byte??Unknown
4 Byte??Unknown, but seems to be folder dependent
4 ByteintNumber of Items
Loop for itemCount------
4 ByteintRepresent the MAPI property 0x8014 ("SideEffects" in OlSpy)
1 BytebyteLength of MessageClass
Length given by previous valueASCIIThe MessageClass (e.g. IPM.Task) of the item
1 BytebyteNumber of Unicode chars of Subject
Number of Unicode chars * 2UnicodeThe subject of the item
4 BytesintEntryId length
Length given by previous valuebinaryThe MAPI EntryId of the item
4 BytesintSearchKey length
Length given by previous valuebinaryThe MAPI SearchKey of the item
4 Bytes??Unknown, seems to be always E0 80 E9 5A
Outlook 2016/Office 365: 32 Bytes(not sure why or when this changed)
Outlook 2013: 24 Bytes
Outlook 2010: 20 bytes
Outlook 2007: 16 bytes
?? Apparently all 0-bytes, but the 5th:
O2013: 5th byte is 0x08 or 0x09
O2010: 5th byte is 0x18 or 0x08
O2007: 5th byte is always 0x01
Next item ------

About

reverse engineered Outlook drag and drop (clipboard) OLE protocol

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages