I wonder how I can replace every word in a document with some texts:
Document:
Apple
Cat
Replace every of them like:
Text
Text
Code:
Sub test()
For w = 1 To ActiveDocument.Words.Count
ActiveDocument.Words(w).Select
' fail to exclude the space following the selected word
If Not Selection.Text Like " *" Then
Selection.Text = "Text"
End If
Next w
End Sub
But this code just ends up like
Doc:
Text Text
It moves the second one up to the first paragraph
And I'm stuck at how to get rid of the space following the word