Jack Knight
Jack Knight

Reputation: 51

vba add more than one space in vba email body?

I am using vba in outlook to generate an email. I would like to find a way to move some text over to the right, about 100 pixels.

since I don't believe there is a way to incorporate css or styles in vba I am looking for a way to add more than one space to get the text moved over. however when I try space() function and " ", even if I repeat these codes a number of times it only ever gives me one space.

can someone please help me and show me what I need to do, thanks

"<br><br><br>" & "3PL & HAULAGE SUPPLIERS: " & " " & "<font size=""4.5"" face=""calibri"" color=""red"">" & "<b>" & EmailCount & "</b></font>" & vbNewLine & _

Upvotes: 0

Views: 11448

Answers (1)

MrBeAN
MrBeAN

Reputation: 78

This will add 10 white spaces just before 3PL. You may need to adjust as the pixel distance will be relative to the font

TRIED AND TESTED

Sub test()

    Dim WS As String

    WS = "&nbsp"

    For i = 1 To 10
        WS = WS & "&nbsp"
    Next i

    Debug.Print "<br><br><br>" & WS & "3PL & HAULAGE SUPPLIERS: " & " " & "<font size=""4.5"" face=""calibri"" color=""red"">" & "<b>" & EmailCount & "</b></font>" & vbNewLine

End Sub

Upvotes: 1

Related Questions