1

I have four mailboxes in my Outlook 2013 client at work, my personal (Me@MyCompany.Com) and the other three are shared mailboxes for projects/teams I am on, for example, (Sales@MyCompany.Com), (ProjectFinance@MyCompany.Com), etc.

I am using C# and can access the Contacts Address Book for my own mailbox just fine, but I would like to know how to access another mailbox's Contacts?

This works fine when accessing my own Contacts:

Outlook.MAPIFolder myContactsFolder = application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);

What is the equivalent for say mailbox (Sales@MyCompany.Com)? I do have the username and password for this account just in case you need it but I don't believe you need it since I am creating an AddIn that will be used during the user's active session.

emily_bma
  • 301
  • 1
  • 15

2 Answers2

3

Call Namespace.CreateRecipient and pass the returned Recipient object to the Namespace.GetSharedDefaultFolder function.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
0

You can get a store specific default folder using the GetDefaultFolder method of the Store class. So, you can iterate over all stores in the profile and get store-specific folders. The Namespace class provides the Stores property which returns a Stores collection object that represents all the Store objects in the current profile.

See How to: Enumerate Folders on All Stores for more information.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • I don't see how a Store pertains to the Contacts Address Book (CAB)? Why would the Store solution deviate from the solution I used above for my profile's CAB? Thanks – emily_bma Dec 26 '14 at 17:22
  • Did you try to use the `store.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)`; method? – Eugene Astafiev Dec 27 '14 at 09:34