Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to drag and drop an email, from Outlook, into a .NET application?

Tags:

c#

.net

outlook

I am trying to figure out how to drag and drop an email from Outlook 2010 into my .NET application. I've seen quite a few articles, most with very complex solutions. My thought is it shouldn't be that complex ... but I could be wrong.

Any help would be much appreciated!

like image 397
mattruma Avatar asked Oct 10 '10 12:10

mattruma


1 Answers

A easier solution has been posted here: Get body from Outlook email [Drag’n’Drop]

Outlook.Application outlook = new Outlook.Application();
Outlook.Explorer oExplorer = outlook.ActiveExplorer();
Outlook.Selection oSelection = oExplorer.Selection;

foreach (object item in oSelection)
{
    Outlook.MailItem mi = (Outlook.MailItem)item;
    Console.WriteLine(mi.Body.ToString());
}

It uses Microsoft.Office.Interop.Outlook.dll. (It's on NuGet with the same name)

like image 104
Laoujin Avatar answered Oct 13 '22 15:10

Laoujin