Results 1 to 10 of 10
  1. #1
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,417
    Thanks
    33
    Thanked 195 Times in 175 Posts

    What page number is a Bookmark on? (all/any)

    I have a table with a number of hyperlinks in it, one per row. Each hyperlink points to a bookmark within the following text. I wish to have a second column which gives the page number of each hyperlinked bookmark, automatically maintained, much like a Table of Contents. Is there any non-macro way of doing this? Thanks!

    <font color=blue>Bookmark1</font color=blue> Page 1
    <font color=blue>Bookmark2</font color=blue> Page 3
    <font color=blue>Bookmark3</font color=blue> Page 4
    etc...
    BATcher

    Time prevents everything happening all at once...

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

    Re: What page number is a Bookmark on? (all/any)

    You can use PAGEREF fields for this:
    - Press Ctrl+F9 to insert field braces { } (don't type { and } yourself, that won't work)
    - Type the following between the braces, substituting the correct bookmark name:
    <code>
    PAGEREF bookmarkname # "Page 0"
    </code>
    - Press F9 to hide the field code.
    - Repeat for each bookmark.

    PAGEREF fields aren't updated automatically while you edit the document, but they will be when you print or print preview the document. You can also select the table and press F9 to update the fields.

  3. #3
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,417
    Thanks
    33
    Thanked 195 Times in 175 Posts

    Re: What page number is a Bookmark on? (all/any)

    Excellent! Is there any way to (semi-)automate the typing of the PAGEREF text? (I have about 50 bookmarks...)
    BATcher

    Time prevents everything happening all at once...

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

    Re: What page number is a Bookmark on? (all/any)

    You could press Alt+F9 to display field codes.
    After creating one PAGEREF field, select it (i.e. everything between and including the { } braces) and copy it.
    Paste it as many times as needed.
    Then replace the bookmark names. (To automate that would require a macro)
    Finally, press Alt+F9 to hide the field codes, select the table and press F9 to update the fields.

  5. #5
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,417
    Thanks
    33
    Thanked 195 Times in 175 Posts

    Re: What page number is a Bookmark on? (all/any)

    Thanks, Hans, again!

    I'd already tried to cut-and-paste but without the codes being visible, which failed miserably. Having Cutted and Pasteded the PAGEREFs, I can now cut and paste each bookmark name from where it is displayed in the first column!
    BATcher

    Time prevents everything happening all at once...

  6. #6
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,417
    Thanks
    33
    Thanked 195 Times in 175 Posts

    Re: What page number is a Bookmark on? (all/any)

    And now what I hope is the final question!

    When you've pressed F9 to update these page numbers, they have a grey shading behind them when viewed on screen (but not when Print Previewed or Printed).

    Is there any way of reducing, or removing entirely, this field grey-shading, just for the current document? (And if you can give a solution for date/page fields in the header and footer, that would complete my happiness!)

    Thanks
    Attached Images Attached Images
    BATcher

    Time prevents everything happening all at once...

  7. #7
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: What page number is a Bookmark on? (all/any)

    Tools > Options > View > Field Shading > choose an option

    But this is a user setting and applies to all documents.

    StuartR

  8. #8
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,417
    Thanks
    33
    Thanked 195 Times in 175 Posts

    Re: What page number is a Bookmark on? (all/any)

    Thanks, Stuart - pity it can't be a "by-document" setting...
    BATcher

    Time prevents everything happening all at once...

  9. #9
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: What page number is a Bookmark on? (all/any)

    I guess if you were really desperate you could create a set of events for Document_Activate, Document_Open, Document_Close etc that check the current state of this option, set it to the value you want, and reset it to the users preference when they move away from your document. Sounds like a lot of work to me though.

    StuartR

  10. #10
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,417
    Thanks
    33
    Thanked 195 Times in 175 Posts

    Re: What page number is a Bookmark on? (all/any)

    Yes, far too much. My idea was just to make things more visible on-screen. Ho-hum.
    BATcher

    Time prevents everything happening all at once...

Posting Permissions

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