Solved

EWS Managed API Contacts From Public Folders

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
In this video we show how to create a mailbox database 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 Servers >> Data…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

911 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

15 Experts available now in Live!

Get 1:1 Help Now