我从How can I use Outlook to send email to multiple recipients in Excel VBA复制了整个代码块,并在电子邮件的末尾添加了签名。
With OutMail
.Display
End With
Signature = OutMail.Body
With OutMail
.To = sTo
.CC = sCC
.BCC = ""
.Subject = Worksheets("MassEmail").Range("A2") & " WW" & Worksheets("MassEmail").Range("B1")
sHTML = "<HTML><BODY><FONT face=""Calibri, Arial"">"
sHTML = sHTML & "<p style=""font-size:11pt"">Hi,</p>"
sHTML = sHTML & "<p style=""font-size:11pt"">Here is the RMA list WW" & Worksheets("MassEmail").Range("B1") & ". Please review.</p>"
sHTML = sHTML & "<pre style=""font-size:11pt;font-family:Calibri,Arial""> Total: </pre>"
.HTMLBody = sHTML & Signature
.HTMLBody = .HTMLBody & "</FONT></BODY></HTML>"
End With
这是签名的外观
除签名外,输出正常。
我尝试将.htmlbody改为.body,但结果更糟。
.body的输出。
我正在使用Excel / Outlook 2007。
答案 0 :(得分:0)
您需要将消息的格式设置为RichText或HTMLFormat
类似 olFormatHTML 或 olFormatRichText
然后使用 MailItem.HTMLBody =“....”
有关 VBA MVP传奇Ron De Bruin 网站的更多信息