Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting text to bold from Excel and sending Email

Status
Not open for further replies.

AJPic

Programmer
Jun 8, 2005
11
US
Hi, I'm not really a full blown programmer, so take it easy on me. I have a macro in Excel where I'm sending out a mass emailing.

Part of the body of the text needs to be in bold and there are numerous variables throughout the body.

How can I format the the portions of the text in VBA to be bold when sent in the email?

Thanks...
 
Depends on the email client and the format of the message. If you are using Outlook and HTML configurable emails, you just wrap the text in <b> </b> tags eg:

<b>Re BRM/ROD Bonus Reporting</b><br><br>All, please find attached.....

the <br> is a line break so it ends the 1st line and then creates a blank second line before the next piece of text is entered

Rgds, Geoff

A file that big? It might be very useful. But now it is gone

Please read FAQ222-2244 before you ask a question
 
Yes, I am sending the email via Outlook. But I can't quite get it to come out right using your idea.

So if this is my quote, "You need to run fast to win the race." and I wanted "fast" to appear in bold, how exactly would my VBA line look?

Like this?:

EmailBody = "You need to run <b>fast</b> to win the race."

Thanks again...
 
You have to play with the HTMLbody property of the MailItem object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Exactly so but you would use:

HTMLBody = "You need to run <b>fast</b> to win the race."

Rgds, Geoff

A file that big? It might be very useful. But now it is gone

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top