M B

M B

  • NA
  • 10
  • 25.6k

Getting COMException when accessing Emails on Outlook 2013

Apr 25 2016 6:12 AM
Hello I am trying to access my emails in Outlook 2013 via a C#windows service Application.
Visual Studio is started with admin rights and I have added a reference to Microsoft.Outlook 15.0 Bbject Library and used it as Outlook.
My Code:
Outlook.Application myApp = new Outlook.Application();
Outlook.NameSpace mapiNameSpace = myApp.GetNamespace("MAPI");
ns = myApp.GetNamespace("MAPI");
The First line, throws an error message:
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)).
 
 
Do you know any solutions? 
 
 

Answers (1)