2017-09-04 1 views
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에 이미지 열을 추가하는 방법을 제안하십시오.

답변

0

당신은 그렇게 할 수 없습니다. 이진 데이터를 추가 할 수는 있지만 Outlook은 어떤 식 으로든 구문 분석하지 않으며 모든 종류의 이미지를 표시하는 데이 데이터를 사용하지 않습니다.

관련 문제