initializing OutlookEmail object gives Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)

1

When I try to initialize object as:

   OutlookEMail email = new OutlookEMail(MailType);

in C# I get exception:

Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop.Outlook._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063001-0000-0000-C000-000000000046}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

Using Microsoft Office (outlook) 2007. can someone help to resolve that?

c#
email
outlook
asked on Stack Overflow Jul 13, 2012 by Edgar • edited Jul 13, 2012 by Filburt

1 Answer

0

I was having this exact same error, only it was when I ran the most simple line of code:

var outlookApp = new Microsoft.Office.Interop.Outlook.Application();

I tried various fixes proposed like running a "repair" and registering various components. The fix was to change my project target from "Any CPU" to "x86". I am running Windows 8.1 64-bit with 32-bit Office.

answered on Stack Overflow Feb 7, 2014 by ProVega

User contributions licensed under CC BY-SA 3.0