Solved

Excel VBA Building an HTML body for an emal

Posted on 2014-04-07
5
635 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 48

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 26

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now