|
-
May 2nd, 2006, 02:54 PM
#1
Thread Starter
Member
[RESOLVED] loop between two bookmarks, or test EOF???
Hi
I needed to test for end of document equivalently to loop a section, better said between two bookmarks. Let's say from bookmark A to bookmark B, I want to iterate something, so I tried the following, on a document with a few lines:
VB Code:
Sub test()
counter = 0
Do Until (ActiveDocument.Bookmarks("\Sel") = ActiveDocument.Bookmarks("\EndOfDoc"))
Selection.EndKey unit:=wdLine, Extend:=wdExtend
Selection.MoveDown unit:=wdLine, Count:=2
counter = counter + 1
MsgBox counter
Loop
End Sub
The problem with it is that it is an infinit loop, but I don't see why it isn't working as desired!!?? has someone an idea, please?
Last edited by Hack; May 4th, 2006 at 06:58 AM.
Reason: Added [RESOLVED] to thread title
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|