【发布时间】:2016-02-13 04:59:47
【问题描述】:
我向我的电子邮件帐户发送了包含 HTML 表格的 HTML (MIME) 消息,现在我正在浏览 sample VSTO program。我点击了那封特定的电子邮件。
我在代码里:
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?)
我不明白为什么我会收到错误消息。
【问题讨论】:
标签: vsto outlook-addin