![](/img/trans.png)
[英]How to get email addresses from distribution list in outlook using VSTO
[英]Getting addresses from outlook using VSTO
我正在嘗試使用以下代碼從Outlook中獲取與用戶相關聯的地址,並且在某些計算機上它似乎始終失敗:-
var application = CurrentAppointmentItem.Application;
var session = application.Session;
var organizer = CurrentAppointmentItem.GetOrganizer();
var recipient = session.CreateRecipient(organizer.Name);
var addressEntry = recipient.AddressEntry;
var propertyAccessor = addressEntry.PropertyAccessor;
var addressProperty = propertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x800F101E");
錯誤是:-
System.Runtime.InteropServices.COMException (0x80004005): The operation failed.
at Microsoft.Office.Interop.Outlook.PropertyAccessorClass.GetProperty(String SchemaName)
具體來說,我正在嘗試獲取當前用戶的SIP地址(而不是SMTP地址),有人有什么想法嗎?
額外信息:盡管錯誤消息在propertAccessor.GetProperty()上,但在編碼示例中,該接收者的收件人.Resolve()失敗。
PR_EMS_AB_PROXY_ADDRESSES僅在GAL地址條目上可用。 一次性SMTP地址條目中不會顯示該條目。
到底是什么,為什么要努力做?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.