How to format email body?
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 emai开发者_JS百科l:
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
You'll need to use the HTML mail format for that:
OutMail.BodyFormat = olFormatHTML
OutMail.HTMLBody = "<b>Bold</b>, not bold"
精彩评论