0
Outlookビューでカスタムイメージ列を追加したいと思います。 これは私のカスタムコードを追加するサンプルコードです。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);
}
エラー:型「System.Runtime.InteropServices.COMException」の例外がXXXXXX.dll で発生したが、
は、追加情報、ユーザーコードで処理されなかった:データ型がサポートされていません。
Outlookで画像の列を追加する方法をお勧めします。