Indent bullet point in outlook with vba

Even

Board Regular
Joined
Jan 1, 2013
Messages
81
Office Version
  1. 365
Platform
  1. Windows
Hi, I have this code that I use to create a standard mail. However, I am struggling to indent the bullet points. Does anybody know how to do that? It is the condition A and B that I want to indent.

VBA Code:
Sub Send_Mail()

    Dim xOutApp As Object
    Dim xOutMail As Object
    Dim xOutMsg As String
    On Error Resume Next
    Set xOutApp = CreateObject("Outlook.Application")
    Set xOutMail = xOutApp.CreateItem(0)
    xOutMsg = "Hi,<br /><br /> Please view the below renewal conditions.<br /><br />" & _
    "<b>Product X</b><br/> General terms is x % increase. In addition: <br />" & _
    "<li> Condition A: X% </li> <br />" & _
    "<li> Condition B: X% </li>  <br />"
    With xOutMail
        '.From = ""
        .To = ""
        .CC = ""
        .BCC = ""
        .Subject = ""
        .HTMLBody = xOutMsg
        .Display
    End With
    Set xOutMail = Nothing
    Set xOutApp = Nothing
End Sub
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I recently read a thread somewhere where the OP wanted to remove the indent. The answer was to use in line css styles, which is not something I know much about. However, that might get you started. I can't recall if the fact that you are not using list tags (e.g. <ul>) is responsible for your problem - my html is very rusty.
 
Upvote 0
Thanks, Micron. Almost :)
It does indent the text. However, it also makes an extra space down.
 
Upvote 0
That was the problem to start with and somehow the inline style was the fix IIRC. After looking through a dozen pages of my recent posts I found the thread. Note that while the thread refers to the problem as a margin, I'd say that's incorrect if you look at the picture of what is wanted. That space is normal IMO and I wouldn't bother with it, but to each their own.

 
Upvote 0

Forum statistics

Threads
1,218,231
Messages
6,141,281
Members
450,346
Latest member
JSH10

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