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
User contributions licensed under CC BY-SA 3.0