Retrieving Outlook Contacts

Add-in Express™ Support Service
That's what is more important than anything else

Retrieving Outlook Contacts
 
Adam B




Posts: 49
Joined: 2013-12-20
I am attempting to retrieve the outlook contacts, based on this blog entry:

http://www.add-in-express.com/creating-addins-blog/2011/10/27/get-outlook-contacts/

I can get the contacts in: Outlook.OlDefaultFolders.olFolderContacts

However, I don't have the Outlook.OlDefaultFolders.olFolderSuggestedContacts contant defined and when I attempt to get the contacts by casting to that constant

(Outlook.OlDefaultFolders) 30

I get an exception: ?Â?Ð?ìThe Suggested Contacts folder cannot be found.?Â?Ð?í


I?Â?Ð?ém using VS2013 and currently developing against Outlook 2013.

My project is set to support outlook 2007 and greater. Though I could give up Outlook 2007 support.

I'm also targeting .Net 4.0.

Thanks.
Posted 14 Nov, 2014 13:11:30 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Adam,

I answered your question in comments to that blog entry. For the convenience of other forum readers, I post it here as well:

You don?Â?Ð?ét see it because that enumeration value was introduced in Outlook 2010. You can use late binding to get that folder; your ?Â?Ð?ì(OlDefaultFolders )30″ is a correct way. Still, it will only work if your add-in is loaded in Outlook 2010+; you need to check if ADXAddinModule.HostMajorVersion > 12. If you need to switch to supporting Outlook 2010+, please see http://www.add-in-express.com/forum/read.php?FID=5&TID=12836.


Andrei Smolin
Add-in Express Team Leader
Posted 17 Nov, 2014 04:29:40 Top