Unreadable character in Microsoft Word after using Environment.NewLine to split string

I was having an issue with an unreadable character showing up in a Microsoft Word ( Office 365 ) document after using Environment.NewLine to split a single line of addresses into addressLine1 and addressLine2

Below is the Assign process I was using for addressLine1 and addressLine2 separated onto 2 different lines for display in a Word document. Some of the addresses only had one address line while other addresses had two address lines so I had to account for both situations and not have a blank line in the Word document if there wasn’t an addressLine2

addressLines = addressLine1.Trim + Environment.NewLine + addressLine2.Trim

This is what it looked like in the Word document - note the small square in front of addressLine2 ( Apt 109 )

Capture

I replaced the Environment.NewLine with :

addressLines = addressLine1.Trim + vbCr + addressLine2.Trim

That worked as expected. Has anyone else run into this issue using Environment.NewLine in MS Word Office 365 and if so is there an alternative way of handling? If not, then this is one way around that issue.

1 Like

I have this issue as well.
Looking for solutions so I am sorry but I don’t have any better way of solving it.

I will try your solution :slight_smile: