如何拖放电子邮件,从Outlook,到.NET应用程序? [英] How to drag and drop an email, from Outlook, into a .NET application?

查看:140
本文介绍了如何拖放电子邮件,从Outlook,到.NET应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出如何拖放从Outlook 2010邮件到我的.NET应用程序。我见过不少的文章,最具有非常复杂的解决方案。我的想法是它不应该是复杂的...但我可能是错的。



任何帮助将非常感谢!


< DIV CLASS =h2_lin>解决方案

一个简单的解决方案已经被张贴在这里:的从Outlook电子邮件获取体[拖放]

  Outlook.Application前景=新Outlook.Application(); 
Outlook.Explorer oExplorer = outlook.ActiveExplorer();
Outlook.Selection oSelection = oExplorer.Selection;

的foreach(在oSelection对象的项目)
{
Outlook.MailItem MI =(Outlook.MailItem)项目;
Console.WriteLine(mi.Body.ToString());
}



它使用 Microsoft.Office.Interop.Outlook。 DLL 。 (这是对的NuGet名称相同)


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!

解决方案

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)

这篇关于如何拖放电子邮件,从Outlook,到.NET应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆