0
我發送一封HTML格式的HTML(MIME)郵件給我的電子郵件帳戶,現在我正在步行穿過sample VSTO program。我點擊了特定的電子郵件。展望VSTO:MailItem不包含`HTMLBody`的定義
我在這裏的代碼:
using Outlook = Microsoft.Office.Interop.Outlook;
<snip>
currentExplorer = this.Application.ActiveExplorer();
currentExplorer.SelectionChange += new Outlook
.ExplorerEvents_10_SelectionChangeEventHandler
(CurrentExplorer_Event);
private void CurrentExplorer_Event()
{
<snip>
.
.
.
Object selObject = this.Application.ActiveExplorer().Selection[1];
if (selObject is Outlook.MailItem)
{
Outlook.MailItem mailItem =
(selObject as Outlook.MailItem);
BREAKPOINT-> itemMessage = "The item is an e-mail message." +
" The subject is " + mailItem.Subject + ".";
mailItem.Display(false);
}
當我看到在立即窗口mailItem
我得到一個錯誤:
?mailItem.HTMLBody
error CS1061: 'MailItem' does not contain a definition for 'HTMLBody'
and no extension method 'HTMLBody' accepting a first argument of
type 'MailItem' could be found (are you missing a using directive
or an assembly reference?)
我不明白爲什麼我得到錯誤。