My 2013 install of Outlook used to host an Epix email account and an Outlook account. The Outlook 2013 app stopped connecting with Outlook email account so I installed Outlook 2024 version 1.2024.1216.300 and added the Outlook account to that new Outlook version. A C# App I wrote still works fine in opening the Outlook 2013 but it can not find/access the Outlook 2024 install. The following code explores the issue:
using Microsoft.Office.Interop.Outlook;
// Log in to Outlook
NameSpace outlookNamespace = outlookApp.GetNamespace("MAPI");
DebugWrite(outlookApp.Version.ToString(), bWriteMessage); //Returns 15.0.0.5603 (outlook 2013's version)
outlookNamespace.Logon();
DebugWrite(outlookNamespace.Accounts.Count.ToString(), bWriteMessage);//Returns 1(correct for 2013)
DebugWrite(outlookNamespace.Stores.Count.ToString(),bWriteMessage);//Returns 3 (correct for 2013)
foreach(Store store in outlookNamespace.Stores)
{
DebugWrite(store.DisplayName, bWriteMessage);
DebugWrite(store.FilePath, bWriteMessage);
DebugWrite(store.StoreID, bWriteMessage);
}
Is there a way to access the Outlook 2024 install?
2
Few things to check here:
- The
Microsoft.Office.Interop.Outlook
library is typically version-dependent. Outlook 2024 might use a newer version of the COM object model or require updates to your application references. Definitely a point to look for. - If you’re using the Primary Interop Assembly (PIA) for Outlook 2013, you might have to update it to the latest version compatible with Outlook 2024.
- Maybe try using late binding to create an instance of Outlook application (as shown below). This should force the system to load the latest installed version of Outlook.
var outlookType = Type.GetTypeFromProgID("Outlook.Application");
dynamic outlookApp = Activator.CreateInstance(outlookType);
- As a best practice, Microsoft recommends avoiding multiple versions of Outlook on the same machine because they can interfere with each other. So, if possible, see if you can get rid of Outlook 2013 and work only with Outlook 2024.