• 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 keep text bold in email body with VBA

abra

New Member
Hi All,

I want to keep last two line in bold letter from the below code.
can you please help me.

Code:
If (str = "R_4") Then
      esubject = ActiveWorkbook.Worksheets(sht1).Cells(x, 1) & " PGD_Reminder 4"
        sMsgBody = "Dear X" & vbCr & vbCr
        sMsgBody = sMsgBody & "This is to inform you that " & ActiveWorkbook.Worksheets(sht1).Cells(x, 1) & " " & _
                "work is due '" & Format(ActiveWorkbook.Worksheets(sht1).Cells(x, 15), "dd-mmm-yyyy") & "'." & vbCr & vbCr
             
        sMsgBody = sMsgBody & "For any queries/concerns, please reach out to University coordinators." & vbCr & vbCr
        sMsgBody = sMsgBody & "Regards" & vbCr & vbCr
        sMsgBody = sMsgBody & "Vice chancellor." & vbCr & vbCr
        sMsgBody = sMsgBody & "Note: " & vbCr & vbCr
        sMsgBody = sMsgBody & "Please use the latest link to use University URL" & vbCr & vbCr
        ebody = sMsgBody
     
      End If
 
You should have a look at htmlBody instead of Body.
Code:
htmlBody = "Line 1<br>" _
& "<b>Line 2</b><br>" _
& "Line 3"
The <br> is the line break tag in HTML and the <b> will bolden the text.
 
Back
Top