How to format email body?

时光怂恿深爱的人放手 提交于 2020-07-24 04:06:00

问题


I'm opening an Outlook email from Excel.

I would like to format the body, e.g. using a certain font and making a few words bold.

Here is my VBA code for opening an email:

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
    .To = strRecipient
    .CC = ""
    .BCC = ""
    .subject = strSubject
    .body = strBody
    .Display
End With

回答1:


You'll need to use the HTML mail format for that:

OutMail.BodyFormat = olFormatHTML
OutMail.HTMLBody = "<b>Bold</b>, not bold"


来源:https://stackoverflow.com/questions/1867013/how-to-format-email-body

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!