如何将Outlook中的电子邮件拖放到.NET应用程序中?

mat*_*uma 7 .net c# outlook

我试图弄清楚如何将Outlook 2010中的电子邮件拖放到我的.NET应用程序中.我见过很多文章,大多数都有非常复杂的解决方案.我的想法是不应该那么复杂......但我可能是错的.

任何帮助将非常感激!

Lao*_*jin 5

这里发布了一个更简单的解决方案:从Outlook电子邮件中获取正文[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());
}
Run Code Online (Sandbox Code Playgroud)

它使用Microsoft.Office.Interop.Outlook.dll.(它与NuGet同名)