This project has moved and is read-only. For the latest updates, please go here.

OutlookApi.NavigationModule Cast Error

Oct 14, 2015 at 9:02 PM
Edited Oct 14, 2015 at 9:28 PM
After about 3 hours of trying to solve this problem on my own I posted this question. Literally 5-10 minutes after I posted this question I figured out that I can use "new Outlook._ContactsModule(NavigationModules.GetNavigationModule(OlNavigationModuleType.olModuleContacts))" and it will convert to a _ContactsModule and give me the .NavigationGroups property that I needed.


I'm trying to get a ContactsModule Object from outlook but I keep getting a cast error:

NetOffice.OutlookApi.NavigationModules NavigationModules = OutlookApp.Session.GetDefaultFolder(OlDefaultFolders.olFolderContacts).GetExplorer().NavigationPane.Modules;
NetOffice.OutlookApi.ContactsModule ContactsModule = NavigationModules.GetNavigationModule(OlNavigationModuleType.olModuleContacts);

I'm completely lost on what I'm doing wrong. Any ideas?