I am looking for a way to replace RichTextBox
multiple spaces and tabs with html characters so that they are shown correctly in Outlook .HTML
mail body.
I tried using that for tabs:
msg = msg.Replace(vbTab, "<td>")
But it does not work. I do now know what to do for multiple spaces - I do not find any <> code to use in this code:
msg = msg.Replace(" ", "<what to put here?>")
All ideas will be greatly appreciated!
CodePudding user response:
The HTML entity for space is
and the entity for tab is  
.
Here is how you would apply it to your RichTextBox:
Dim message = MyRichTextBox.Text.Replace(" ", " ").Replace(ControlChars.Tab, " ")