string ExchangeContactFolder = Configuration.ExchangeContactFolder; Folder ContactFolder = GetTopLevelFolder(_service, ExchangeContactFolder); ItemView itemView = new ItemView(int.MaxValue); FindItemsResults<Item> searchResults = _service.FindItems(ContactFolder.Id, itemView); int totalContacts = searchResults.TotalCount; //Setting properties for Custom Fields. Guid FacebookGuid = new Guid("{a49b36f1-7895-4637-98ec-1ca35a345095}"); var FacebookAddress = new ExtendedPropertyDefinition(FacebookGuid, "Facebook", MapiPropertyType.String); itemView.PropertySet = new PropertySet(BasePropertySet.IdOnly); itemView.PropertySet.Add(FacebookAddress); FindItemsResults<Item> contactItems = _service.FindItems(ContactFolder.Id, view); foreach (Item item in contactItems) { if (item is Contact) { string strFacebookAddress = string.Empty; contact.GetLoadedPropertyDefinitions(); //item.TryGetProperty(FacebookAddress, out strFacebookAddress); contact.TryGetProperty(FacebookAddress, out strFacebookAddress); strContacts.Add(bcSearch); } } } return strContacts;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)