2017-08-31 85 views
0

我在Exchange.WebServices.Data.Contact中的哪個位置可以找到與Outlook.ContactItem.SelectedMailingAddress相關的屬性?Exchange.WebServices.Data.Contact:郵寄地址在哪裏?

Outlook已Outlook.ContactItem.SelectedMailingAddress屬性,它持有Microsoft.Office.Interop.Outlook.OlMailingAddress枚舉:

_currentContact.SelectedMailingAddress = Microsoft.Office.Interop.Outlook.OlMailingAddress.olBusiness; 

Outlook還填充全套地址屬性:

_currentContact.MailingAddress = _currentContact.BusinessAddress; 
_currentContact.MailingAddressCity = _currentContact.BusinessAddressCity; 
_currentContact.MailingAddressCountry = _currentContact.BusinessAddressCountry; 
_currentContact.MailingAddressPostalCode = _currentContact.BusinessAddressPostalCode; 
_currentContact.MailingAddressState = _currentContact.BusinessAddressState; 
_currentContact.MailingAddressStreet = _currentContact.BusinessAddressStreet; 

但我在EWS中找不到郵寄地址。 Exchange.WebServices.Data.PhysicalAddressKey枚舉只包含Business,Home和Other。

我在這裏拉我的頭髮!任何幫助或方向都會得到真正的讚賞。

由於

+0

你有沒有檢查[ProxyAdress(HTTPS進行設置(或獲取值):// MSDN .microsoft.com/en-us/library/aa563519(v = exchg.80).aspx)如此處所述? – BastianW

+0

感謝您花時間看看這位巴斯蒂安! ProxyAddress可能會影響EWS聯繫人對象的單個屬性嗎?我可以通過EWS檢索和更新聯繫人,而不會造成任何問題。我的問題是設置哪個地址(業務,家庭,其他)是郵寄地址。推測這是聯繫對象的單個屬性(也許是擴展屬性?)。 –

回答

1

的PidLidPostalAddressId https://msdn.microsoft.com/en-us/library/ee179151(v=exchg.80).aspx屬性指定的地址都作爲郵政地址。在EWS您需要使用擴展屬性如

ExtendedPropertyDefinition PidLidPostalAddressId = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Address, 0x8022, MapiPropertyType.Integer); 
Contact.SetExtendedProperty(PidLidPostalAddressId, 0x00000002); 

會的郵件地址設置到業務地址

+0

非常感謝!明天我會先試一試。我有一種感覺,這是一個擴展的財產。我搜索了幾個小時想到的所有東西。再次感謝您花時間與我分享您的一些知識。 –