how to add bold to a section in my email vba code

Patriot2879

Well-known Member
Joined
Feb 1, 2018
Messages
1,259
Office Version
  1. 2010
Platform
  1. Windows
Hi good morning all, Please can help with the code below, the section half way down where it says Comments: I want this to be in bold, I have tried <b> but this didn't work, please can you help me?
Code:
Private Sub CommandButton2_Click()
    If TextBox9.Value = "" Then
        MsgBox "Please enter 'Comments'"
        Exit Sub
    Else

    End If
Dim aOutlook As Object
Dim aEmail As Object
Dim rngeAddresses As Range, rngeCell As Range, strRecipients As String
Set aOutlook = CreateObject("Outlook.Application")
Set aEmail = aOutlook.CreateItem(0)
        aEmail.Body = "Hi There," & Chr(10) & vbCrLf & _
                      "Appt Number: " & Me.TextBox8.Value & Chr(10) & _
                      "MPAN / MPRN: " & Me.TextBox7.Value & Chr(10) & _
                      "Job Type: " & Me.ComboBox6.Value & Chr(10) & _
                      "Post Code: " & Me.TextBox3.Value & Chr(10) & _
                      "Comments:" & Me.TextBox9.Value & Chr(10) & _
                      "Activity: " & Me.ComboBox3.Value & Chr(10) & _
                      "Action: " & Me.ComboBox1.Value & Chr(10) & vbCrLf & _
                      "Many thanks " & Chr(10)
        aEmail.Recipients.Add (Worksheets("Email Links").Range("A2").Value)
    
        aEmail.CC = ""
        aEmail.BCC = ""
        aEmail.Subject = "" & UserForm3.ComboBox3.Value & " " & Worksheets("Handover").Range("K1").Value
        aEmail.Display

End Sub
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi,

You should use the HTMLBody property (instead of .Body .htmlBody ) and then use HTML to format your text ...

Hope this will help
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
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