Family Tree
Dillahunty Family
Darla Baerg
Ideah Agency
I Get To!!
Craft a Craft
Peachbush Enterprises
Peachbush Gallery
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)
- bdillahu's blog
- Login or register to post comments