Trying to automate Outlook as
Microsoft.Office.Interop.Outlook.Application myApp = new Microsoft.Office.Interop.Outlook.ApplicationClass();
Microsoft.Office
I ran into the exact same error message you have, my problem was I had installed Office 2016 x64 while the app that was trying to call into it was compiled as x86. Switching to x86 Office 2016 solved the issue for me.
I had this problem too. I use Mobisynapse desktop app to update my Android Calendar and contacts. Using Office 2010 I decided to upgrade to Office 2016. After seeing it was a Office 365 product I uninstalled it. This caused the Registry to change the Office 2010 Primary Interop Assemblies to change from 32 bit to 64 bit. The Mobisynapse MB4Outlook started reporting sync error "Sync Failed". Mobisynapse – Moffice error 3/31/19 Sync Failed – there is a problem with outlook – on the desktop When I click on Auto Sync settings I get “Please update MB4Outlook add-in first” From where it is installed with your app.
Solution to this problem occurs when you try an Office365 product that is 64bit and have a 32 bit of office 2007-2013 installed. Step 1: uninstall Office xxxx primary interop assemblies. If the package is not found download from here. https://www.microsoft.com/en-US/Download/confirmation.aspx?id=3508 Install it. Step 2: run Office xxxx Install and select repair. Step 3: Reboot and it should fix the problem.
have you tried this?
Microsoft.Office.Interop.Outlook.Application myApp = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.NameSpace mapiNameSpace = myApp.GetNamespace("MAPI");
This exception usually happens when you had two versions of Office installed and then uninstalled one. Run a repair installation for your still installed Office, this should fix the registry keys.