In writing some code to loop until the end of the file in a Word macro, there are a couple of approaches:
Do Until ActiveDocument.Bookmarks("\Sel") = _
ActiveDocument.Bookmarks("\EndOfDoc")
Loop
End Sub
Note, I have had this at least once fail to ever find the end of the file. It just infinite looped one line above an empty line that happened to be at the end.
This method worked for me:
Do