Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    smi
    Guest

    Bookmarks in word (word 97)

    Help! Is it possible to view the names of the bookmarks that have been created in a word document? I can get the locations to show but not the actual name of the bookmarks? Thanks!

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Bookmarks in word (word 97)

    If you go to Insert, Bookmark, you should see a list of exixting bookmarks. Also if you use Edit, Go To and select bookmark, you get a list of names that you can select from.

    Andrew C

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

    Re: Bookmarks in word (word 97)

    If you're not averse to using macros, here are a couple that are useful when building templates:

    This one will insert the name of each bookmark in the document, immediately after the location of the bookmark - never run this in your template! - always run it in a copy or in a document based on the template:

    <pre>Public Sub TypeEachBmkName()
    Dim aBmk As Bookmark
    Dim strBmkName As String

    If Documents.Count > 0 Then
    For Each aBmk In ActiveDocument.Bookmarks
    strBmkName = aBmk.Name
    aBmk.Range.InsertAfter strBmkName
    Next aBmk
    End If
    End Sub
    </pre>

    This one produces a list of all the bookmarks in a given document, in a new document:

    <pre>Public Sub ListBookmarksByName()
    Dim myBook As Bookmark
    Dim strBooklist As String
    strBooklist = "Alphabetical list of bookmarks in " _
    & ActiveDocument.FullName & ":" & vbCr

    For Each myBook In ActiveDocument.Bookmarks
    strBooklist = strBooklist & myBook.Name & vbCr
    Next
    Documents.Add
    Selection.TypeText strBooklist
    End Sub
    </pre>

    Gary

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Bookmarks in word (word 97)

    Prime Consulting makes an add-on that includes a toolbar that, when you click it, lists all your bookmarks. If you click one, you're sent there. It's a goodie. Check their site at <A target="_blank" HREF=http://www.primeconsulting.com/software/index.html>http://www.primeconsulting.com/software/index.html</A>

    Fred

  5. #5
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Bookmarks in word (word 97)

    I'll check it out, but I'm curious. How is this different from clicking on the browse object and selecting GoTo bookmark or pressing F5 and picking bookmark?

    I guess I'll find out.
    Charles Kyle Kenyon
    Madison, Wisconsin

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Bookmarks in word (word 97)

    Charles,

    not much difference. The bookmark also has a toggle to view the bookmark delimiters [ ].

    fred

  7. #7
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Bookmarks in word (word 97)

    Hi Charles:

    The Prime Consulting gives you a drop down menu on a toolbar. It's much faster to scroll the toolbar listings than click a drop down arrow in a dialog box. You can name the toolbar button with a "&" so that you can open it with an "Alt+hotkey" & then arrow up or down through your bookmarks.

  8. #8
    Bronze Lounger IanWilson's Avatar
    Join Date
    Dec 2000
    Location
    Bristol, United Kingdom
    Posts
    1,523
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Bookmarks in word (word 97)

    What this discussion hasn't directly answered so far is whether there is a way to identify a bookmark's name when you see the marker in your document. I assume that's what the original question was asking. Ideallly I would like to be able to point at a bookmark symbol and have a little pop-up tell me its name. I often work with documents (training manuals) that have been through several versions over the years. They are often littered with bookmarks and it would be great to be able to find out what they are, so as to be able to delete those that are no longer needed..

    Any way of doing that? I too would love to know.

    (You can do it the long way round, by trial and error using the go to function until you strike lucky, but it's not very satisfactory.)

    Ian

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

    Re: Bookmarks in word (word 97)

    Hi Ian,

    You could use the following code:

    Public Sub GetSelectedBookmarkName()
    MsgBox Selection.Bookmarks(1).Name
    End Sub

    Just click an insertion point anywhere inside the bookmark, then run the macro.

    Gary

  10. #10
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Bookmarks in word (word 97)

    Gary:

    This is great! I just put it on my Text Shortcut Menu. Now I can right click any bookmark (I keep View/Bookmarks on) & get its name. <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>

  11. #11
    Bronze Lounger IanWilson's Avatar
    Join Date
    Dec 2000
    Location
    Bristol, United Kingdom
    Posts
    1,523
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Bookmarks in word (word 97)

    That's just what I wanted. Nice one, Gary.

    Phil - forgive my ignorance, but how do I add this to the shortcut menu so I can just right-click them too.

    Ian

  12. #12
    Bronze Lounger IanWilson's Avatar
    Join Date
    Dec 2000
    Location
    Bristol, United Kingdom
    Posts
    1,523
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Bookmarks in word (word 97)

    Don't worry Phil - I've worked it out.

    Ian

  13. #13
    Star Lounger
    Join Date
    Jan 2001
    Location
    U.S. - East Coast
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Bookmarks in word (word 97)

    You could also click near a bookmark (anywhere within its range) and press ctrl+shift+F5. This combination could be assigned to an "F" key if you prefer.

  14. #14
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Bookmarks in word (word 97)

    Like Phil, I think this is great! Sometimes, though, my bookmarks get a bit tangled, especially if they are put in by macros. I came up with the following modification:

    <pre>Sub GetSelectedBookmarkName()
    ' from Gary Frieder on Woody's Lounge
    ' modified with error handler & multiple bookmark handler by Charles Kenyon
    '
    ' Add to context menus
    Dim iBookCount As Integer 'number of bookmarks
    Dim iCount As Integer 'counter for loop
    Dim sName As String 'holds bookmark name in loop
    '
    On Error GoTo NoBookMark
    iBookCount = Selection.Bookmarks.Count
    If iBookCount > 1 Then
    For iCount = 1 To iBookCount
    sName = Selection.Bookmarks(iCount).Name
    MsgBox Prompt:="The selection is in " & iBookCount & " bookmarks!" _
    & vbCrLf & "The name of bookmark No." & iCount & " is " _
    & sName & ".", _
    Buttons:=vbInformation, Title:="Multiple Bookmarks Names"
    Next iCount
    Exit Sub
    End If
    MsgBox Prompt:="The bookmark's name is " _
    & Selection.Bookmarks(1).Name & ".", _
    Buttons:=vbInformation, Title:="Bookmark Name"
    Exit Sub
    NoBookMark:
    MsgBox Prompt:="There is no bookmark here.", _
    Title:="Sorry!", Buttons:=vbExclamation
    End Sub
    </pre>


    So far it works well. Thought I would share.
    Charles Kyle Kenyon
    Madison, Wisconsin

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

    Re: Bookmarks in word (word 97)

    Hi Charles,

    A question and a suggested tweak:

    A question about the error handler and message - it looks like you want this message to display if the selection contains 0 bookmarks, but it's unclear what condition is expected to cause the error - if there are no bookmarks in the selection, you'd get a count of 0, but that won't cause an error to occur.

    Also, it looks like if there is more than one bookmark in the selection, then both message boxes are going to show(?) (since you have the second one outside the If structure.)

    One way to handle all the different Count eventualities would be to use a Select Case structure - this would be along the lines of:

    Select Case iBookCount
    Case 0
    MsgBox saying there's no bookmarks
    Case 1
    MsgBox saying there's one bookmark
    Case Else
    Loop and msgbox saying there's multiple bookmarks
    End Select

    - a side benefit being that you don't need to use an Error event to prompt the display of the 0 bookmarks MsgBox.

    Regards,
    Gary

Page 1 of 2 12 LastLast

Posting Permissions

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