Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML Email via VBA with bullets

Tags:

html

excel

vba

I am struggling to get my HTML formatting correct on an automated email generated through VBA. I have never used HTML before in my life, so this is a totally new thing for me... I have tried to research online already but I just can't make sense of this.

.HTMLBody = "<style> body{color:black;font-family:Calibri;font-size: 11pt;}" & "<HTML><body>Dear " & Addressee & ",<br><br>As you would be aware, the...<br><br>Please find attached spreadsheet showing:<br><br>&emsp;&mdash;&emsp;Example list 1. <br>&emsp;&mdash;&emsp;Example list 2. <br>&emsp;&mdash;&emsp;Example list 3.<br><br> <b>Kindly reply to ALL indicating...</b><br><br> Regards,<br><br>" & Signature

The problem with the above is that it doesn't automatically indent the lines if they subsequently move into a second row as I have "created" fake bullets. Also, this code above is terribly basic (reflecting my lack of understanding :/) - but I essentially want to find a way to have a bunch of text, list 3 bullets keeping all the formatting as would be in the case of normal bullets (i.e. indent the lines) and then have a conclusion and normal end of email.

Any chance someone will be able to assist me with the HTML code to have bullets..? I have cleared out a lot of the text in the above code due to confidential information.

Thank you!

like image 494
Dames Avatar asked Feb 05 '23 02:02

Dames


1 Answers

You want to use an Ordered List which uses the layout of:

<ol>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ol>

Where the <ol> tag stands for Ordered List and the <li> tags stand for List Item. The above code produces the following:

  1. Item 1
  2. Item 2
  3. Item 3

Alternatively, if you don't want numbers and just want bullet points you can use an Unordered List which uses the same layout except the <ol> tag changes to <ul>:

<ul>
  <li>Item 1</li>
  <li>Item 2</li>
  <li>Item 3</li>
</ul>

And looks like this:

  • Item 1
  • Item 2
  • Item 3
like image 74
Jordan Avatar answered Feb 07 '23 19:02

Jordan