Solved

EWS Managed API Contacts From Public Folders

Posted on 2013-05-16
1
1,551 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

Shouldn't all users have the same email signature?

You wouldn't let your users design their own business cards, would you? So, why do you let them design their own email signatures? Think of the damage they could be doing to your brand reputation! Choose the easy way to manage set up and add email signatures for all users.

Join & Write a Comment

ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
This video discusses moving either the default database or any database to a new volume.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now