在outlook中修改内联响应的HTMLBody [英] Modify HTMLBody for Inline Response in outlook
问题描述
我正在尝试修改Outlook中内联回复的正文。我需要在内联响应编辑器中插入HTML。
$
我试图这样做:
                   
I am trying to modify the body of an inline reply in Outlook. I need to insert HTML into the inline response editor.
I am trying to do it like this:
var explorer = application.ActiveExplorer();
MailItem item = explorer.ActiveInlineResponse;                      
MailItem item = explorer.ActiveInlineResponse;
item.Subject =" INLINE SUBJECT";                      
item.Subject = "INLINE SUBJECT";
item.HTMLBody = item.HTMLBody.Replace(" Test"," INLINE BODY");
item.HTMLBody = item.HTMLBody.Replace("Test", "INLINE BODY");
由于某种原因,item.Subject设置正确,但正文未设置。我使用替换来确保我没有弄乱HTML - 我想我会尝试用另一个单词替换一个单词而不修改HTML。
我尝试使用`ActiveInlineResponseWordEditor`更改内联响应中的文本 - 但问题是我需要插入HTML而我不知道如何使用单词编辑器对象。
关于如何成功修改`HtmlBody`或使用`ActiveInlineResponseWordEditor`插入html的任何想法?
谢谢!
                   
For some reason, the item.Subject is set correctly but the body doesn't get set. I used the replace to make sure I wasn't messing up the HTML - I thought I would just try to replace a word with another word without modifying the HTML.
I tried changing the text in the inline response using `ActiveInlineResponseWordEditor` which worked - but the problem is that I need to insert HTML and I dont know how to do that using the word editor object.
Any ideas of how I can either successfully modify the `HtmlBody` or insert html using `ActiveInlineResponseWordEditor` ?
Thank you!
推荐答案
你试过分配吗? HTML Body而不是替换它。
did you try to assign the HTML Body instead of replacing it.
如下所示。
Sub CreateHTMLMail()
'Creates a new e-mail item and modifies its properties.
Dim objMail As Outlook.MailItem
'Create e-mail item
Set objMail = Application.CreateItem(olMailItem)
With objMail
'Set body format to HTML
.BodyFormat = olFormatHTML
.HTMLBody = _
"<HTML><BODY>Enter the message text here. </BODY></HTML>"
.Display
End With
End Sub
参考:
MailItem.HTMLBody Property(Outlook)
问候
这篇关于在outlook中修改内联响应的HTMLBody的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!