Solved

EWS Managed API Contacts From Public Folders

Posted on 2013-05-16
1
1,778 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
In this video we show how to create an Address List 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 Organization >> Ad…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Suggested Courses

623 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