[英]How to add bitmap image in outlook custom column
我想在Outlook視圖中添加自定義圖像列。 這是我添加自定義圖標的示例代碼。
Outlook.Explorer explorer = this.Application.ActiveExplorer();
Outlook.Selection selection = null;
try { selection = explorer.Selection; }
catch { }
if (selection != null && selection.Count > 0)
{
object item = selection[1];
if (item is Outlook.MailItem)
{
Outlook.MailItem mail = item as Outlook.MailItem;
Outlook.UserProperties userProperties = mail.UserProperties;
Outlook.UserProperty userProperty = userProperties.Add("SyncStatus", Outlook.OlUserPropertyType.olEnumeration, true, Outlook.OlFormatEnumeration.olFormatEnumBitmap);
userProperty.Value = new Bitmap(@"...\icons\Sync.ico");
mail.Save();
Marshal.ReleaseComObject(userProperty);
Marshal.ReleaseComObject(userProperties);
}
Marshal.ReleaseComObject(item);
Marshal.ReleaseComObject(selection);
}
錯誤:XXXXXX.dll中發生類型'System.Runtime.InteropServices.COMException'的異常,但未在用戶代碼中處理
附加信息:不支持數據類型。
請建議如何在Outlook中添加圖像列。
你不能這樣做。 即使可以添加二進制數據,Outlook也不會以任何方式解析它,也不會使用它顯示任何類型的圖像。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.