C#interop Outlook:无法转换“Microsoft.Office.Interop.Oulook.ApplicationClass”类型的COM对象

时间:2014-01-16 21:51:00

标签: c# email outlook pia

通过在MS 2010中开发的MS Outlook 2010发送电子邮件的c#代码完美无缺:

1. using Outlook = Microsoft.Office.Interop.Outlook;
...
2. Outlook.Application outlookApp = new Outlook.Application();
3. Outlook.MailItem mail = outlookApp.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
...

在使用MS Outlook 2013的其他电脑上使用此程序时:第3行出现以下错误:

  

无法将“Microsoft.Office.Interop.Oulook.ApplicationClass”类型的COM对象强制转换为接口类型“Microsoft.Office.Interop.Oulook._Application”。此操作失败,因为由于以下错误,IID为“{00063001-0000-0000-C000-000000000046}”的接口的COM组件上的QueryInterface调用失败:不支持此类接口(HRESULT异常:0x80004002(E_NOINTERFACE))

删除Outlook Interop引用并在VS 2013中添加最新版本15无济于事。 如何使用Outlook 2013发送邮件? 是否可以使用具有相同代码的Outlook 2010?

0 个答案:

没有答案
相关问题