Change font, size, color for email body

john55

New Member
Joined
Oct 31, 2010
Messages
26
hello!
I use this code for email and I want to have different font text, size and color for it.
I appreciate your help!
Rich (BB code):
Set olEmail = olApp.CreateItem(olMailItem)
With olEmail
.To = ""
.cc = ""
.Subject = "" & "-" & Format(Now, "dd_mmmm_yyyy")
.BodyFormat = olFormatHTML
.HTMLBody = "test for" & " " & Format(Now, "dd mmmm yyyy") & _
"" & "Brgds," & "" & "me" & "" & "" & "" & "This text font Courier New, size 11" & _
"" & "" & "" & "This text font Courier New, bold, color blue, size 11" & _
"" & "e-mail: aaa@bbb.com" & "" & "Website: www.gggg.com"
.display
End With
'With Sheet2
regards
j
 
Last edited:

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
You would need to use HTML tags for that.

What do you have at the moment in HTMLCode?
 
Upvote 0
hi Norie,
thanks, as you saw I tried to add code tags but ...well, that's it! :) hope you can see what I want to say...

j
 
Upvote 0
hi Andrew,
I can not edit the first post anymore,
HTML:
Set olEmail = olApp.CreateItem(olMailItem)
            With olEmail
              .To = ""
              .cc = ""
              .Subject = "" & "-" & Format(Now, "dd_mmmm_yyyy")
              .BodyFormat = olFormatHTML
                .HTMLBody = "test for" & " " & Format(Now, "dd mmmm yyyy") & _
                "<br/>" & "Brgds," & "<br/>" & "me" & _
                "<br/>" & "<br/>" & "<br/>" & "This text font Courier New, size 11" & _
                "<br/>" & "<br/>" & "<br/>" & "This text font Courier New, bold, color blue, size 11" & _
                "<br/>" & "e-mail: aaa@bbb.com" & "<br/>" & "Website: www.gggg.com"
              .display
              End With
            'With Sheet2

thank you Norie, I followed the link from yr signature! :)
 
Last edited:
Upvote 0
John

If you want to post HTML wrap it in
HTML:
tags.
 
Upvote 0
Solved.
HTML:
"<br/>" & "<br/>" & "<br/>" & "<font face=""Courier New"" size=""2"" color=""blue"">" & "This text font Courier New, size 2, color blue..or whatever" 
'
'
 
Upvote 0

Forum statistics

Threads
1,215,781
Messages
6,126,869
Members
449,345
Latest member
CharlieDP

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top