Checking for End of Document in Word VBA
Checking for End of Document in Word VBA
(OP)
As a newbie, I haven't figured out how to check in a Word VBA macro as to whether I'm at the end of the document.
I'd like to include a check within a Do...While loop to avoid it being an infinite loop.
I'd like to include a check within a Do...While loop to avoid it being an infinite loop.
RE: Checking for End of Document in Word VBA
Sub DocEnd()
ActiveDocument.StoryRanges.Item(wdMainTextStory).Select
Selection.EndOf (wdStory)
End Sub
It will position your cursor at the end of the document.
Dan