How to make part of my VBA bulk email in bold

Jayway

New Member
Joined
Jul 19, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I am sending bulk emails out and have the following VBA. I would like to make the bodysubHeader bold but keeping the bodyHeader and bodyMain as normal. How can I do this?

Sub SendMultipleEmails()

Dim OutApp As New Outlook.Application
Dim OutMail As MailItem

lr = Cells(Rows.Count, "D").End(xlUp).Row
bodySignature = "Best Regards," & vbLf & "Phillips 66 Compliance Team"
For r = 2 To lr
Set OutMail = OutApp.CreateItem(olMailItem)

With OutMail
.To = Range("D" & r).Value
.Subject = Range("E2").Value
bodyHeader = "To " & Range("C" & r).Value & ","
bodysubHeader = Range("B" & r).Value
bodyMain = Range("F2").Value
.Body = bodyHeader & vbLf & vbLf & bodysubHeader & vbLf & vbLf & bodyMain & vbLf & vbLf & bodySignature
.Attachments.Add Range("G2").Value
.Display
' .send
End With
Next r

Set OutMail = Nothing
Set OutApp = Nothing



End Sub
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Edit - did the wrong part.

Replace the .Body line with:

VBA Code:
            .HTMLBody = bodyHeader & "<br><br><b>" & bodysubHeader & "</b><br><br>" & bodyMain & "<br><br>" & bodySignature

PS - please post VBA code inside VBA code tags:

[CODE=vba]
code here
[/CODE]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top