Reputation: 565
I have a string that contains vbNewLine positions.
For example :
Dim strSalesOrderRemarksas string
strSalesOrderRemarks= "Hello" & vbNewLine
strSalesOrderRemarks= strExample & "World"
When I debug via Access I see:
Hello
World
Then I pass this string to an Outlook mail object.
I have a mail template that contains a body with text, in this text there is a string like this {strBody}.
Then, when I want to replace this part with the strExample it gets shown in the mail without the vbNewLine. So the output in the mail is: helloworld
This was the actual line of code
.HTMLBody = Replace(.HTMLBody, "{strBody}", strSalesOrderRemarks)
I looked at similar problems, most of them containing info about replacing a vbNewLine.
Upvotes: 0
Views: 152
Reputation: 565
This is how it should be : Thanks to Brax
strSalesOrderRemarks = Replace(strSalesOrderRemarks, vbNewLine, "<br>")
'
.HTMLBody = Replace(.HTMLBody, "{strBody}", strSalesOrderRemarks)
Upvotes: 1