07-31-2012, 12:56 PM
Join Date: Jul 2012
Making text in e-mail bold and underline in VB Code
I'm looking to make the text in the e-mail that is automatically populated from my excel document be bold. I only want part of it to be bolded though. I'm sure this is a very simple task; however, I'm not able to figure it out. I've copied my code below.
'For mail code examples visit my mail page at:
Dim OutApp As Object
Dim OutMail As Object
Dim strto As String, strcc As String, strbcc As String
Dim strsub As String, strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strto = "email@example.com"
strcc = ""
strbcc = ""
strsub = "Customers"
strbody = "Hi Ron" & vbNewLine & vbNewLine & _
"The total Customers of all stores this week is : " & Cells(FormulaCell.Row, "B").Value & _
vbNewLine & vbNewLine & "Good job"
.To = strto
.CC = strcc
.BCC = strbcc
.Subject = strsub
.Body = strbody
'You can add a file to the mail like this
.Display ' or use .Send
Set OutMail = Nothing
Set OutApp = Nothing