使用Exchange服务c#从outlook获取共享联系人列表

时间:2015-10-14 12:20:35

标签: c# exchange-server

有没有办法使用c#,交换服务获取用户共享联系人列表(由其他用户联系)?

我能够使用以下代码获得用户联系,同样我也想要共享联系人

        ExchangeService serviceData = Authenticate(username, password);
        FindAllContactsAndContactGroups(serviceData);
        ContactsFolder contactsfolder = ContactsFolder.Bind(serviceData, WellKnownFolderName.Contacts);
        int numItems = 50;// contactsfolder.TotalCount < 50 ? contactsfolder.TotalCount : 50;
        ItemView view = new ItemView(int.MaxValue);
        view.PropertySet = new PropertySet(BasePropertySet.IdOnly, ContactSchema.DisplayName);
        FindItemsResults<Item> contactItems = serviceData.FindItems(WellKnownFolderName.Contacts, view);
        List<Item> items = new List<Item>();
        List<OutlookContact> ContactList = new List<OutlookContact>();
        foreach (Item item in contactItems)
        {
            OutlookContact Outlookcontact = new OutlookContact();
            if (item is Contact)
            {
                items.Add(item);
                serviceData.LoadPropertiesForItems(items, PropertySet.FirstClassProperties);
                Contact contact = item as Microsoft.Exchange.WebServices.Data.Contact;