Outlook 从Exchange中存储的ContactInfo获取Smtp电子邮件

Outlook 从Exchange中存储的ContactInfo获取Smtp电子邮件,outlook,vsto,exchange-server,outlook-addin,Outlook,Vsto,Exchange Server,Outlook Addin,我正在将VSTO用于Outlook加载项。目前我正在处理所有Outlook联系人的电子邮件地址。如果EmailAddress1Type为“SMTP”,则ContactInfo实例没有问题 但是如何获取Exchange联系人的电子邮件地址(email1address type=“EX”) 赎回图书馆不是我的解决方案,因为它是昂贵的,只是为了解决这一个问题 提前谢谢大家, Dusan以下是示例代码和相应的示例代码: private const string Email1EntryIdProperty

我正在将VSTO用于Outlook加载项。目前我正在处理所有Outlook联系人的电子邮件地址。如果EmailAddress1Type为“SMTP”,则ContactInfo实例没有问题

但是如何获取Exchange联系人的电子邮件地址(email1address type=“EX”)

赎回图书馆不是我的解决方案,因为它是昂贵的,只是为了解决这一个问题

提前谢谢大家,

Dusan

以下是示例代码和相应的示例代码:

private const string Email1EntryIdPropertyAccessor=”http://schemas.microsoft.com/mapi/id/{00062004-0000-0000-C000-0000000000 46}/80850102”;
PropertyAccessor PropertyAccessor=contactItem.PropertyAccessor;
对象rawPropertyValue=propertyAccessor.GetProperty(Email1EntryPropertyAccessor);
字符串RecipientRyId=propertyAccessor.BinaryToString(rawPropertyValue);
收件人=contactItem.Application.Session.GetRecipientFromID(RecipientRyId);
if(null==收件人)
抛出新的InvalidOperationException();
bool wassolved=recipient.Resolve();
如果(!已解决)
抛出新的InvalidOperationException();
ExchangeUser ExchangeUser=recipient.AddressEntry.GetExchangeUser();
字符串smtpAddress=exchangeUser.PrimarySmtpAddress;