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

Access VBA send html body email question 1

Status
Not open for further replies.

vamoose

Programmer
Oct 16, 2005
320
MX
I am using Access 2003 VBA to generate an Outlook 2007 email which is working fine. In the .HtmlBody section I would like to have 3 lines of text instead of just one which is what I am getting now. So my question is how to create a carriage return in the .HtmlBody section of the email text. Thank you.

With OutMail
.To = mail_to_list
.CC = ""
.BCC = ""
.Subject = "Varnish Tank Status, Philips EMAG, Juarez"
.HtmlBody = "<html>Raw varnish level: " & raw_gallons & " gallons. Day tank varnish level: " & day_gallons & " gallons. Last Updated: " & lastupdateraw & "</html>"
.Send
End With
 
You can put html breaks (<br>) between the lines or any of a number of other html elements like paragraphs, divs, etc.

e.g.
Code:
.HtmlBody = "<html>Raw varnish level: " & raw_gallons & " gallons.[blue]<br>[/blue] Day tank varnish level: " & day_gallons & " gallons.[blue]<br>[/blue] Last Updated: " & lastupdateraw & "</html>"
or
Code:
        .HtmlBody = "<html><p>Raw varnish level: " & raw_gallons & " gallons. 
<p>Day tank varnish level: " & day_gallons & " gallons. 
<p>Last Updated: " & lastupdateraw & "</html>"
etc.


Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top