Outlook VSTO:MailItem不包含“HTMLBody”的定义`
我向我的电子邮件帐户发送了一条包含HTML表的HTML(MIME)消息,现在我正在浏览一个电子邮件。我点击了那封邮件 我在这里的代码:Outlook VSTO:MailItem不包含“HTMLBody”的定义`,vsto,outlook-addin,Vsto,Outlook Addin,我向我的电子邮件帐户发送了一条包含HTML表的HTML(MIME)消息,现在我正在浏览一个电子邮件。我点击了那封邮件 我在这里的代码: using Outlook = Microsoft.Office.Interop.Outlook; <snip> currentExplorer = this.Application.ActiveExplorer(); currentExplorer.SelectionChange += new Outlook .
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);
}
我不明白为什么我会出错 尝试使用后期绑定技术(请参见.Net中的)访问属性 您是否在辅助线程上运行代码?您使用什么事件处理程序访问主体 无论如何,Outlook对象模型不为签名提供任何内容。但您可以在运行时使用VBA宏编辑消息体 Outlook对象模型提供了三种处理项目主体的主要方法:
?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?)