• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to format text with different styles in sent email from excel via vba

RutaGedvilaite

New Member
Hey,

I have this code. But I need to bold text from cell K14 and change text color of cells K21-K25.

How can I do that?

Please help
frown.png


Sub SendMail()

'SendEmail Macro
'
'
Dim outlApp As Outlook.Application
Set outlApp = CreateObject("Outlook.Application")

Dim outlMail As Outlook.MailItem
Set outlMail = outlApp.CreateItem(outlMailItem)


outlMail.To = Range("K5") ' <-- Put email of the recipient here
outlMail.Subject = "DOVANOS - fejerverkai Naujiesiems!"
outlMail.CC = Range("K6") ' <-- Put email of 'copy to' recipient here
outlMail.Body = Range("K8") & vbLf & vbLf _
& Range("K9") & vbLf & vbLf _
& Range("K10") & vbLf & vbLf _
& Range("K11") & vbLf & vbLf _
& Range("K12") & vbLf & vbLf _
& Range("K13") & vbLf & vbLf _
& Range("K14") & vbLf & vbLf _
& Range("K15") & vbLf & vbLf _
& Range("K16") & vbLf & vbLf _
& Range("K17") & vbLf & vbLf _
& Range("K18") & vbLf & vbLf _
& Range("K19") & vbLf & vbLf _
& Range("K20") & vbLf & vbLf _
& Range("K21") & vbLf & vbLf _
& Range("K22") & vbLf & vbLf _
& Range("K23") & vbLf & vbLf _
& Range("K24") & vbLf & vbLf _
& Range("K25") & vbLf _


outlMail.send

End Sub
 
Back
Top