Solved

EWS Managed API Contacts From Public Folders

Posted on 2013-05-16
1
1,642 Views
Last Modified: 2013-05-17
I am working on an application that needs to pull contact data from a public folder.
I am able to pull contact data from a user's mailbox with the following code:
            ContactsFolder contactsfolder = ContactsFolder.Bind(service,
                                                                WellKnownFolderName.Contacts,
                                                                new PropertySet(BasePropertySet.IdOnly, FolderSchema.TotalCount));
            int numItems = contactsfolder.TotalCount < 1000 ? contactsfolder.TotalCount : 1000;
            ItemView view = new ItemView(numItems);
            view.PropertySet = new PropertySet(BasePropertySet.IdOnly, ContactSchema.DisplayName);
            FindItemsResults<Item> contactItems = service.FindItems(WellKnownFolderName.Contacts, view);

Open in new window

If I replace WellKnownFolderName.Contacts with the Folder ID of the public folder I still get the results from WellKnownFolderName.Contacts.  How can I get contacts from a public folder?
0
Comment
Question by:jmichael18
1 Comment
 
LVL 31

Accepted Solution

by:
LeeDerbyshire earned 500 total points
ID: 39174295
WellKnownFolderName.Contacts appears twice in the code. Are you sure you are replacing
both instances?

I know that is a bit of an obvious answer, but using the public folder id should have worked,
and I can't think of anything else that would explain it.

I all else fails, turn on request tracing.

http://msdn.microsoft.com/en-us/library/exchange/dd633676(v=exchg.80).aspx
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Utilizing an array to gracefully append to a list of EmailAddresses
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question