【问题标题】:Exchange.WebServices.Data.Contact: Where's the Mailing Address?Exchange.WebServices.Data.Contact:邮寄地址在哪里?
【发布时间】:2017-08-31 16:19:09
【问题描述】:

我可以在 Exchange.WebServices.Data.Contact 的什么位置找到与 Outlook.ContactItem.SelectedMailingAddress 相关的属性?

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。

我要拔头发了!任何帮助或指导将不胜感激。

谢谢

【问题讨论】:

  • 您是否按照此处的说明检查了ProxyAdress
  • 感谢您抽出宝贵时间查看此巴斯蒂安! ProxyAddress 可能会影响 EWS 联系人对象的单个属性吗?我可以毫无问题地通过 EWS 检索和更新联系人。我的问题是设置哪个地址(企业、家庭、其他)是邮寄地址。大概这是联系人对象的单个属性(也许是扩展属性?)。

标签: c# outlook exchange-server exchangewebservices contacts


【解决方案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);

将邮寄地址设置为公司地址

【讨论】:

  • 非常感谢!我明天第一件事就试试看。我有一种感觉,它是一个扩展属性。我用谷歌搜索了几个小时能想到的一切。再次感谢您抽出宝贵时间与我分享您的一些知识。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-04-08
  • 2016-01-26
  • 2019-01-07
  • 2011-05-14
  • 1970-01-01
相关资源
最近更新 更多