'Using HTML tag in vba code to customize generated email
I am trying to manipule html tags to customize an generated email.
I don't have any struggle to use organizing tags such as <p> or <br />...
However it is when I try to modify font I am struggling.
Here an example of the String I am sending :
messsage = "<section> <p> Madame, Monsieur, <br /> </p> <p> Blablablabla. <br /> </p> <p> <span font-size="" 16px; font-weight: bold;""> blablabla : </span>" & Sheets(4).Range("A" & i + 1).Value & " </p> <br /> <p> blablabla.<br />blablala. </p> <br /> <p> blabla : " & objDict.Items(i) & " </p> <br /> <p> blabla </p> </section> "
It is <span font-size="" 16px; font-weight: bold;""> blablabla : </span> I am getting wrong.
This gives me no font modification.
I want to learn from this, so, if possible, explain to me what I'm doing wrong here, or if my approach is lacking insight.
Solution 1:[1]
I finally found my error. I was trying to use CSS in HTML but Outlook doesn't seem to process it. I managed to use genuine HTML tags liek this :
<p> <font size=""4""> <b> Blablalbla </b> </font> </p>
So instead of using <span style=""font-size:16px> liek suggested in comments, the tag <font size=""4""> </font> is doing the same.
However HTML tags are limited to what CSS tags can offer.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | LyessD |
