using vbCrLf in email body does not work with HTMLBody

T

Tom Joseph

I was using the following to include some user defined text in the message
body. The vbCrLf was working fine when the message was in text format. When
I switched to HTML, the vbCrLf instruction does not work.

Is there another approach?

Also, How do I specify a font for the HTML body in the code?

Thanks very much.



With SafeItem
.To = emails
.CC = ""
.BCC = ""
.Subject = Worksheets("eMail").Range("C117").Value & _
Format(Sheets("Main").Range("AB5").Value, "mm/dd/yy") & _
", " & Format(Sheets("Main").Range("AB6").Value) & _
" - " & Worksheets("eMail").Cells(4, i).Value
.HTMLBody = Worksheets("eMail").Range("C121").Value & vbCrLf & _
Worksheets("eMail").Range("C122").Value & vbCrLf & _
Worksheets("eMail").Range("C123").Value & vbCrLf & _
Worksheets("eMail").Range("C124").Value & vbCrLf & _
Worksheets("eMail").Range("C125").Value & vbCrLf & _
Worksheets("eMail").Range("C126").Value & vbCrLf & _
Worksheets("eMail").Range("C127").Value & vbCrLf & _
Worksheets("eMail").Range("C128").Value & vbCrLf & _
Worksheets("eMail").Range("C129").Value & vbCrLf & _
Worksheets("eMail").Range("C130").Value & vbCrLf & _
vbCrLf & _
Worksheets("eMail").Range("C134").Value & _
Worksheets("eMail").Range("C135").Value & _
Worksheets("eMail").Range("C136").Value & _
Worksheets("eMail").Range("C137").Value & _
Worksheets("eMail").Range("C138").Value & _
Worksheets("eMail").Range("C139").Value
.Attachments.Add FilenameStr
.Attachments.Add FilenameStr2
.Attachments.Add FilenameStr3
.Attachments.Add FilenameStr4
.Send 'or use .Display
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top