Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Another 'End of' Request (97 SR2)

    Is there a better way to test for end of document than this:

    if activedocument.Bookmarks("endofdoc").Range.End =
    selection.End then
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Another 'End of' Request (97 SR2)

    Yes, maybe - depends on what you want: (btw am testing this in Word 2K)

    Testing your sample appears to indicate that the endofdoc bookmark isn't really exactly at the end of the doc: it seems to be just before the last paragraph mark (which makes sense if you think about it - hidden or not, how could you have a bookmark either on top of or after the last paragraph mark?). So if the IP is just to the left of the last paragraph mark, then this returns True. But if for example you select the last paragraph mark, this does not return True.

    The following will produce the opposite results - False if IP is just before last para mark, True if Selection includes last para mark:

    If ActiveDocument.Range.End = Selection.End Then

    (... if that is what you need...)
    Now, how to get one that returns True in both cases?(if that is what you need)....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •