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
Solved

Excel VBA Building an HTML body for an emal

Posted on 2014-04-07
5
678 Views
Last Modified: 2014-04-11
Hi
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
0
Comment
Question by:murbro
5 Comments
 
LVL 39

Assisted Solution

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

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

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 125 total points
ID: 39985233
Hi,

pls try

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

Open in new window

Regards
0
 
LVL 35

Assisted Solution

by:Kimputer
Kimputer earned 125 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>"
0
 
LVL 27

Accepted Solution

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

www.onlinehtmleditor.net/¿

http://www.quackit.com/html/online-html-editor/
0
 

Author Closing Comment

by:murbro
ID: 39995375
Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

789 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