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!

vbCrLf in text box? for line break in email message 1

Status
Not open for further replies.

TomYC

Technical User
Dec 11, 2008
191
US
I hope that was clear--
I have code that references a text box to create the message body of an Outlook email. For clarity I would like a line feed or two, but I haven't been able to do in the text box/Outlook combination what is easy to do in MsgBox!
I have code such as:
stMessageBody = txtMessageBody & Chr(13) & Chr(10) & txt2ndParagraph
which doesn't work, but I've tried vbNewLine and vbCrLf as well. Is this even possible?
The code fits into a simple Outlook output:
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)

With MailOutLook
.To = stRptRecipient
.Subject = stSubjectLine
.HTMLBody = stMessageBody
.Send
End With
-- Thanks!
 
What about this ?
stMessageBody = txtMessageBody & "<BR>" & txt2ndParagraph

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you PHV---
I wouldn't have thought it would be html code, but it was!
 
TomYC said:
I wouldn't have thought it would be html code, but it was!

This would depend on your Outloop Settings (Options, Mail Format).
 
In fact, the reason was here:
.[!]HTML[/!]Body = stMessageBody

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top