Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    WD2K: Bookmarks in HEader/Footers (VBA, W2K, O2K)

    Hi,

    I have a procedure that inserts a legal disclaimer in the footer at the last page of my document
    After the insertion it adds a bookmark in the beginning of the disclaimer with the .add method.

    Prior to publishing my document, I need to find the disclaimer and update it to the most recent version.
    The below code is a snap that is expected to handle this. Most of it goes OK, I get into the correct footer, verifies that the bookmark exists, but then comes troubles...

    ActiveWindow.View.SeekView = wdSeekCurrentPageFooter
    If ActiveDocument.Bookmarks.Exists(Name:="zBP_Disclai mer") = True Then
    Selection.GoTo what:=wdGoToBookmark, Name:="zBP_Disclaimer"
    End If

    When I use the .goto it fails with err.number "Run-time error '5678' - Word cannot find the requested bookmark"
    - then I select debug... and the selection exists the footer and goes back to printview (which puzzles me a bit)

    My question is: being in the footer - why can't I use the .goto here...???


    Thanks,
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: WD2K: Bookmarks in HEader/Footers (VBA, W2K, O2K)

    I don't know why it doesn't work, but try this:

    ActiveWindow.View.SeekView = wdSeekCurrentPageFooter
    If ActiveDocument.Bookmarks.Exists(Name:="zBP_Disclai mer") Then
    ActiveDocument.Bookmarks("zBP_Disclaimer").Select
    End If

Posting Permissions

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