Hi I am having similar issue
but want customized solution.
I want to sent email with attachment for which my code works but if OutLook app is already opened as desktop app, then I am getting this error.
Requirement: I want to open outlook window showing everything like when we compose message in window.
I am doing this:
Microsoft.Office.Interop.Outlook.Application outlookApp = new Outlook.Application();
Getting this error if OutLook app is running.
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
When I close OutLook no error and everything works like I want. I dont want to close OutLook pro grammatically as other solutions suggested here
Just 1 more thing to mention that I am using Microsoft.Office.Interop.Outlook.dll is this 32bit/64bit problem? Or have to use some other new Dll?
The error is CO_E_SERVER_EXEC_FAILURE. Most likely this happens if the security context of your app and Outlook are different. Is either app running with elevated privileges (Run As Administrator)?
Finally I found my answer. I tested and its working.
Found it here
User contributions licensed under CC BY-SA 3.0