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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Code to change outlook font to Red and Bold 1

Status
Not open for further replies.

Raynepau

Technical User
Dec 30, 2010
33
GB
To Anyone who can help

I have created some code from within excel that uses a command button

When the command button is clicked in excel in creates an email message and this works fine

However, I would like to change some of the text in the email to Bold and Red

If someone could give me some advice on this it would be much appreciated

Thanks
 
You need to send the email in html or rtf. Then you have all manner of formatting.
 
Xwb

Thanks for you help. Would you be able to give some advice about the correct syntax

Thanks
 
How are you sending the email. Is it something like
Code:
Dim olApp As Outlook.Application
Dim olMail As MailItem

Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)

With olMail
  .To = "someone@anywhere.com"
  .Subject = "The subject"
  .BodyFormat = olFormatPlain
  .Body = "I would really like this in red"
End With
Instead of using .Body use .HTMLBody. You can embed HTML in it and add your signature at the same time
Code:
   .BodyFormat = olFormatHTML
   .HTMLBody = "I would really like <font color=""red"">this</font> in red"
   .HTMLBody = .HTMLBody & "<br/><br/>Excel Daemon"
 
Thanks xwb

I'll give this a try and let you know if this works

Thanks
 
xwb

Excellent advice !. This works

Many thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top