Change the font on Emails

Eric Penfold

Active Member
Joined
Nov 19, 2021
Messages
431
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
The code on this is supposed to Change the font but I can`t seem to get the HTMLBody code to show black?

VBA Code:
Sub Mail_small_Text_Outlook()

    Dim xOutApp As Object
    Dim xOutMail As Object
    Dim xMailBody As String
    Dim ws     As Worksheet
    Dim Rng    As Range
    Dim LRow   As Long, RowNo As Long
    Dim Cell   As Range
    Dim x      As String
    Dim Found  As Boolean
    Dim EmailAddress As String
    Dim WsConfig As Worksheet
    Dim lngStartRow As Long

    Set xOutApp = CreateObject("Outlook.Application")
    Set xOutMail = xOutApp.CreateItem(0)
    Set ws = ThisWorkbook.Worksheets("Data")
    Set WsConfig = ThisWorkbook.Worksheets("Config")
    LRow = ws.Cells(Rows.Count, 1).End(xlUp).Row
    RowNo = ActiveCell.Row
    
    If ActiveCell.Offset(0, 2) = "A" Then
        EmailAddress = ("alton@Drainfast.co.uk")
    ElseIf ActiveCell.Offset(0, 2) = "B" Then
        EmailAddress = ("basildon@drainfast.co.uk")
    ElseIf ActiveCell.Offset(0, 2) = "C" Then
        EmailAddress = ("warehousecov@Drainfast.co.uk")
    End If
    
    On Error Resume Next
    
    With xOutMail
        .To = EmailAddress
        .CC = ""
        .BCC = ""
        .Subject = "BO Queries"
      HTMLBody = "<p style='font-family:Arial;font-size:11'>" & _
                   "<br><br> Do you know why this is a back order? Intact is showing you have the stock?" & _
                   "<br><br> Is it Any of these Codes SL-DS-SD?" & _
                   "<br><br> ws.Range("C" & ActiveCell.Row).Value" & " \ " & "ws.Range("E" & ActiveCell.Row).Value" & _
                   " <br><br> Kind Regards"
        .Display
        '        .Send
    End With
    On Error GoTo 0
    Set xOutMail = Nothing
    Set xOutApp = Nothing
End Sub
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,223,879
Messages
6,175,148
Members
452,615
Latest member
bogeys2birdies

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