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

Inserting carriage return in Outlook HTML from Access VBA 1

Status
Not open for further replies.

merlynsdad

Programmer
Nov 18, 2010
175
US
I'm having a problem inserting a carriage return in Outlook HTML being sent via Access VBA. Here's the pertinent line of code.
Code:
objMail.HTMLBody = "Ticket " & intTixNum & " has been entered into Ticket Tracker by " & strEmpName & " concerning " & strIssue & ". " & strSomestr & "  "
I understand chr(13) and chr(10) only work in text mode, but can't find the corresponding code to use in HTML. I need the break between the period after strIssue and strSomestr.

If the square peg won't fit in the round hole, sand off the corners.
 
You're using HTML email, so doesn't your string need to be in html?
Code:
objMail.HTMLBody = "Ticket " & intTixNum & " has been entered into Ticket Tracker by " & strEmpName & " concerning " & strIssue & ". <br />" & strSomestr & "  "

or

Code:
objMail.HTMLBody = "<p>Ticket " & intTixNum & " has been entered into Ticket Tracker by " & strEmpName & " concerning " & strIssue & ". </p><p>" & strSomestr & "</p> "

----------------------------------------------
Ben O'Hara
David W. Fenton said:
We could be confused in exactly the same way, but confusion might be like Nulls, and not comparable.
 
That makes perfect sense, and it works perfectly. Thanks!

If the square peg won't fit in the round hole, sand off the corners.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top