Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Excel VBA Building an HTML body for an emal

Posted on 2014-04-07
Medium Priority
Last Modified: 2014-04-11
I have started using the following code to build an HTML body for an email
How do I change Font color and do a line return?

oMsg.HTMLBody = "<html><body>My Body</body></html>"
oMsg.BodyFormat = 2
Question by:Murray Brown
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 39

Assisted Solution

by:Pratima Pharande
Pratima Pharande earned 500 total points
ID: 39985204
Try this

oMsg.HTMLBody = "<html><body><font size=3  color=red>My Body </font></body></html>"
LVL 53

Assisted Solution

Rgonzo1971 earned 500 total points
ID: 39985233

pls try

oMsg.HTMLBody = "<html><body><font size=3  color=red>My <br>Body </font></body></html>"

Open in new window

LVL 36

Assisted Solution

Kimputer earned 500 total points
ID: 39985295
For different sizes, colors and line returns:

oMsg.HTMLBody = "<html><body><font size=3  color=red>line 1</font><br><font size=2  color=blue>line 2</font><br><font size=1  color=green>line 3 </font><br></body></html>"
LVL 27

Accepted Solution

MacroShadow earned 500 total points
ID: 39985357
There are many WYSIWYG free  online html editors, you design the text as you like and it returns the html.¿

Author Closing Comment

by:Murray Brown
ID: 39995375

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

671 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question