3
我試圖讓在Outlook中的郵件的附件的內容ID的。我使用Add-In Express作爲我的加載項,但它沒有功能來獲取它。獲取附件內容識別
我知道贖回庫,但它不是免費的,因此不適合我的選擇。
在Outlook 2007+存在PropertyAccessor接口,這應該允許我這樣做,但我不能得到它的工作。
這裏我的代碼:
string uniqueId = "";
object props = a.GetType().InvokeMember("PropertyAccessor", BindingFlags.Public | BindingFlags.GetField | BindingFlags.GetProperty, null, a, null);
object[] args = new object[1];
args[0] = @"urn:schemas:mailheader:content-id";
object value = props.GetType().InvokeMember("GetProperty", BindingFlags.Public | BindingFlags.InvokeMethod, null, props, args);
if ((string)value != null) {
uniqueId = (string)value;
}
「a」 是從一個外接快速的MailItem得到的附件。
它只是拋出以下異常:「異常已通過調用的目標引發異常。」
有人可以幫助我嗎?