2017-08-31 86 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

非常感谢!明天我会先试一试。我有一种感觉,这是一个扩展的财产。我搜索了几个小时想到的所有东西。再次感谢您花时间与我分享您的一些知识。 –