Results 1 to 3 of 3
  1. #1
    5 Star Lounger kmurdock's Avatar
    Join Date
    Feb 2003
    Location
    Pacific Grove, California, USA
    Posts
    716
    Thanks
    10
    Thanked 34 Times in 28 Posts

    VBA Cannot find existing bookmark (Word XP / SP2)

    OK, this is a little freaky.

    I've got code that pops from one bookmark to another in a Word document. I named one of my bookmarks "cc" -- they all have names that refer to what goes there.

    All the other bookmarks work -- except this one. The bookmark is there and the code to delete it works. But it will not move the selection to the bookmark. It is in a table, but then, two others are in the same table and VBA visits them.

    I have deleted and recreated the bookmark. When I step through the code and hover over the "Name:=" switch of the GoTo command, instead of "cc" it displays "Microsoft Word" -- needless to say I don't have any bookmarks with that name.

    I have tried renaming it but to no avail. VBA will simply not move my selection to that bookmark. It also seems to do the same thing a little later in the project, this time refusing to go to a bookmark that it has already successfully visited.

    This is a template. When I manually move between bookmarks (either in the template or a document based on the template), I am completely successful. What gives here?

    Any enlightenment?

    Thanks,
    Kim

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: VBA Cannot find existing bookmark (Word XP / SP2)

    Does the document have form fields in it?

    If so is is possible that more than one of the form fields have the same bookmark name. There is something fishy about form fields and bookmark names.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    5 Star Lounger kmurdock's Avatar
    Join Date
    Feb 2003
    Location
    Pacific Grove, California, USA
    Posts
    716
    Thanks
    10
    Thanked 34 Times in 28 Posts

    Re: VBA Cannot find existing bookmark (Word XP / SP2)

    Edited to reveal solution ...

    <<No, no form fields. It's a fairly straightforward single page with nothing but tables and bookmarks in it. >>

    << I will see if I can find anything else that might be there but unseen, but otherwise, it's just a strangeness.>>

    I did. I DID NOT HAVE THE SYNTAX CORRECT IN THE CODE!!! (I need to step away from the computer every now and then...)

    Thank you all anyway, but this time it was PEBCAK -- Problem Exists Between Chair And Keyboard. <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23>
    Kim

Posting Permissions

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