Drag and Drop Items from Outlook - Record Message IDs

Background:

I am developing an application that will allow you to transfer elements to it and invoke some lengthy processes on them. Items are usually dragged from the file system and from Outlook. The last thing bothers me.

How can I connect to Outlook to find out if a message (or several) has been output from it and into my application, and what is a message identifier?

I understand that the Outlook object model does not have such drag and drop events, and one of them - listening to Windows messages - is not possible in the team, because our combined knowledge of Interop is small.

We will use C # 4.0 in Visual Studio 2010 to develop this application.

+3
source share
2 answers

You cannot access MailItem.EntryIDdirectly from Outlook through the common IDataObjectdrag-n-drop interface. If you just want to access MSG data, you can use this CodeProject example . When MSG is copied to disk (or clipboard, drag-n-drop, etc.), it loses the link to EntryID.

The only way to access EntryIDit is to use VSTO and use ActiveExplorer().Selectionit to see which items are selected during the drop action. The following is an example of accessing the body of a selected message during the drag-n-drop command. You can find many examples as soon as you see the general template.

+1
source

All Articles