我正在尝试从Outlook中获取HTML。文本格式被设置为HTML,这就是exchange服务器在我发送它之后将接收的内容。
我可以通过以下方式获得文本:
if (e.Current.ControlType == ControlType.Document && e.Current.Name == subject+" - Message")
{
TextPattern v = (TextPattern)e.GetCurrentPattern(TextPattern.Pattern);
System.Console.WriteLine("DOC:"+ v.DocumentRange.GetText(-1));
}有什么方法可以使用.NET自动化特性从编辑器中读取HTML吗?
发布于 2015-07-09 10:35:54
我觉得你上错班了。我从Microsoft support网站上的一个示例中提取了以下片段。HTMLBody是getter/setter (尽管在本例中它被用作setter )。
Outlook.MailItemClass mItem = (Outlook.MailItemClass)doc.MailEnvelope.Item;
mItem.Subject = strSubject;
mItem.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
mItem.HTMLBody = GetString(strBody);https://stackoverflow.com/questions/31313358
复制相似问题