【发布时间】:2017-08-16 05:21:43
【问题描述】:
你好,我也有类似的问题
但想要定制的解决方案。
我想发送带有我的代码适用的附件的电子邮件,但如果 OutLook 应用程序已作为桌面应用程序打开,那么我会收到此错误。
要求:我想打开 Outlook 窗口,显示我们在窗口中撰写消息时的所有内容。
我正在这样做:
Microsoft.Office.Interop.Outlook.Application outlookApp = new Outlook.Application();
如果 OutLook 应用程序正在运行,则会出现此错误。
Error sending a report: System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).
at ReportViewerControl.SendOutLookMail_Click(Object sender, EventArgs e) in c:\Projects\MSCatalog\MS SQLSERVER\Web\UserControls\Reports\ReportViewerControl.ascx.cs:line 262
当我关闭 OutLook 时没有错误,一切都按我的意愿运行。我不想像这里建议的其他解决方案那样以编程方式关闭 OutLook
我正在使用的还有 1 件事需要提及 Microsoft.Office.Interop.Outlook.dll 这是 32 位/64 位的问题吗?还是必须使用其他一些新的 Dll?
【问题讨论】: