The page you requested does not exist. A search for loop until end file word macro resulted in this page.

Loop until end of file in Word macro

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
   
Loop Until (Selection.End = ActiveDocument.Content.End - 1)