In my Access form a user can enter some text in a text block. Usually there are multiple line breaks in this text (so in the properties of the textbox the enter functionality is changed to return a line break instead of going to another record).
The text that a user types in the form will replace some text in a word document using the VBA find and replace function:
With objWord.Selection.Find
.Forward = True
.Wrap = 1
.ClearFormatting
.Execute2007 FindText:="{IndexText}", ReplaceWith:=NewIndexText, Replace:=2 'string is less than 255 so replace it
End With
This works fine, though when the user uses line breaks in their text I get these weird blocks in my Word document:
How can I get to show the Line breaks correctly without the blocks (and also without the Line break symbol).
P.S. I also build in code for handling text with more than 255 characters but just didn't post the code since its unnecessary for this question.
NewIndexText = Replace(NewIndexText, Chr(10), "")
– Nicolas