C# code works without any issues while accessing outlook items in office 2010 with 32 bit. But when office 2010 is upgraded to office 2013 with 64 bit the code is showing an exception
COMException was unhandled
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80004023 A Microsoft Software Installer error was encountered. (Exception from HRESULT: 0x80004023)
Here is my code:
Reference -> .Net Tab->Microsoft.Office.Interop.Outlook
Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook._NameSpace olNS = oApp.GetNamespace("MAPI");
Microsoft.Office.Interop.Outlook.MAPIFolder oPublicFolder = olNS.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olPublicFoldersAllPublicFolders);