Shira L.
Shira L.

Reputation: 81

Change font size & font family (long name) on Outlook mail through VBA

In addition to the question : Change HTML email body font type and size in VBA, i would like to know how can i change both the font size & the font family with long name. Here is my code which change only the font size:

strbody = "<BODY style=" & Chr(34) & "font-size:12pt;" & Chr(34) & "font-family:Times New Roman" & Chr(34) & ">" & "Hello" & "</BODY>"

When i remove the font size from the code it's indeed change the font-family.

Thanks for your assistance,

Upvotes: 0

Views: 1137

Answers (1)

user4039065
user4039065

Reputation:

Try using single quotes within the quoted string. It's allowed in HTML styles.

strbody = "<BODY style='font-size:12pt;font-family:Times New Roman'>" & "Hello" & "</BODY>"

Upvotes: 3

Related Questions