Reputation: 143
I am taking values from Excel in a Do While loop, and each value is pasted in an Outlook mail every time the loop runs. I want to put that value in Outlook in BOLD font and also in CAPS.
Do until k = row_cnt
val1 = Worksheets("Sheet1").Range("A" & k).Value
Set myApp = CreateObject("Outlook.Application")
Set myItem = myApp.CreateItem(olMailItem)
With myItem
.Subject = subj
.To = email_add
.HTMLBody = "Hello " & val1 & "Thanks"
.Display
'.send
End With
Loop
Upvotes: 1
Views: 704
Reputation: 11755
This will make it bold and UPPER CASE:
.HTMLBody = "Hello <b>" & UCase$(val1) & "</b> Thanks"
you could also use a stronger inline style
.HTMLBody = "Hello <span style='font-weight:bold !important;'>" & UCase$(val1) & "</span> Thanks"
or if you wanted to do it all with an inline style:
.HTMLBody = "Hello <span style='font-weight:bold; text-transform:uppercase;'>" & val1 & "</span> Thanks"
Upvotes: 1