Outlook 2016 automation through MAPI with interop dll

1

I have a problem with a Outlook solution - it worked fine with Office 2007-2013. We recently updated Office to Version 2016 and now we get an error. I don't understand why, we use the Interop.Outlook.dll from Visual Studio 2015(Office2013/2016 Add-in).

We cannot downgrade because Office 365 does not allow it anymore.

I get a runtime error:

InvalidCastException; Unable to cast COM object of the type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface 'Microsoft.Office.Interop.Outlook._Application'. Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)

using Outlook = Microsoft.Office.Interop.Outlook;

Outlook.Application app = null;
Outlook.Namespace ns = null;

app = new Outlook.Application();
ns = app.GetNameSpace("MAPI"); -> this is where the exception is thrown.

Can you please explain why i get this error and maybe give me a tipp, solution or workaround? :) Best regards,
Stefan

c#
office365
mapi
outlook-2016
asked on Stack Overflow Jun 26, 2017 by Stefan M. • edited Jun 26, 2017 by Krunal

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0