Re: Display a multi-line text box from User Form in a generated outlook e-mail
Originally Posted by Tnashnhsp1
If anyone is looking to a solution to this I have come to the conclusion that there isn't one without the user adding either "<br>" (html) or vbnewline in the User Form field, depending on whether the body of the e-mail is html or not.
The only way around it to have multiple text boxes in the User form for each line, in your code reference each field and add a line break (as above) if field is not blank, any empty fields won't display, any filled in fields will appear with a line break after them.
This will replace the ASCII line feeds in the text to HTML line breaks
strbody = Replace(strbody, vbLf, "<br>")
You may have to use vbCr or vbCrLf instead of vbLf depending on the ASCII character used in the text.
Surround your VBA code with CODE tags e.g.;
[CODE]your VBA code here[/CODE]
The # button in the forum editor will apply CODE tags around your selected text.
Bookmarks