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

19,498

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)

Share:
19,498
mattruma
Author by

mattruma

I fell in love with computers when I got my first Commodore 64! Check me out on twitter at http://www.twitter.com/mattruma

Updated on June 14, 2022

Comments

  • mattruma
    mattruma almost 2 years

    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!