Thanks in advance for any help.
I'm trying to create an email from an excel file. Currently works fine, however I'm looking to BOLD certain parts of the .Body string. It was suggested that I use .HTMLBody for some quicker easy coding, but I'm not that HTML savy and haven't been able to simply change a variable within the .Body string to contain the HTML bold code without it crashing everything.
Can this be done with the current olEmail format, or is HTML the only way to accomplish this? I'm looking for " Range("I21").Value" to be bold from the code below:
I'm trying to create an email from an excel file. Currently works fine, however I'm looking to BOLD certain parts of the .Body string. It was suggested that I use .HTMLBody for some quicker easy coding, but I'm not that HTML savy and haven't been able to simply change a variable within the .Body string to contain the HTML bold code without it crashing everything.
Can this be done with the current olEmail format, or is HTML the only way to accomplish this? I'm looking for " Range("I21").Value" to be bold from the code below:
VBA Code:
Sub Email()
Dim olApp As Outlook.Application
Set olApp = CreateObject("outlook.application")
Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.Body = Range("I3").Value & vbNewLine & vbNewLine & Range("I5").Value & vbNewLine & _
vbNewLine & Range("I7").Value & vbNewLine & vbNewLine & Range("I9").Value & vbNewLine & vbNewLine & _
Range("I11").Value & vbNewLine & vbNewLine & Range("I13").Value & vbNewLine & vbNewLine & _
Range("I15").Value & vbNewLine & vbNewLine & Range("I17").Value & vbNewLine & vbNewLine & _
Range("I19").Value & vbNewLine & vbNewLine & Range("I21").Value & vbNewLine & vbNewLine & Range("I23").Value
olMail.SentOnBehalfOfName = "emailrequests"
olMail.To = Range("C3").Value
olMail.Subject = Range("E3").Value
olMail.BCC = "emailrequests@xyzcorp.com" & ";" & Range("D10").Value
olMail.Display
End With
End Sub