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!
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Bookmarks in word (word 97)
Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Bookmarks in word (word 97)
- This topic has 15 replies, 8 voices, and was last updated 23 years, 4 months ago.
Viewing 2 reply threadsAuthorReplies-
WSAndrew Cronnolly
AskWoody Lounger -
WSGary Frieder
AskWoody LoungerNovember 28, 2001 at 6:29 am #1793381If 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:
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
This one produces a list of all the bookmarks in a given document, in a new document:
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
Gary
-
WSfburg
AskWoody LoungerNovember 29, 2001 at 6:03 am #1793403Prime 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 http://www.primeconsulting.com/software/index.html
Fred
-
Charles Kenyon
AskWoody Lounger -
WSfburg
AskWoody Lounger -
WSPhil Rabichow
AskWoody LoungerNovember 30, 2001 at 9:52 am #1793431Hi 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.
-
WSIanWilson
AskWoody LoungerDecember 1, 2001 at 3:21 am #1793455What 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
-
WSGary Frieder
AskWoody Lounger -
WSPhil Rabichow
AskWoody Lounger -
WSIanWilson
AskWoody Lounger -
WSIanWilson
AskWoody Lounger -
Charles Kenyon
AskWoody LoungerDecember 6, 2001 at 12:10 am #1793475Like 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:
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
So far it works well. Thought I would share.
-
WSGary Frieder
AskWoody LoungerDecember 6, 2001 at 9:59 am #1793478Hi 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 -
Charles Kenyon
AskWoody LoungerDecember 8, 2001 at 2:31 am #1793487Hi Gary,
Thanks for the feedback.
I wrote this for use in a context menu, assuming that the person using it might not have bookmark delimiters displayed. If the selection point is not in (or does not contain) any bookmarks, the error handler picks up on trying to get the name of a non-existing bookmark. (Member of collection does not exist.)
MsgBox Selection.Bookmarks.Name will generate such an error. You are right that I could test for Count = 0 instead. I’m not aware of any reason for preferring one method over the other (except that the error handler would also be triggered by an unforseen error).
If there is more than one bookmark, the code produces one message box for each bookmark, giving the total number of bookmarks, the number of this bookmark, and the name of this bookmark. Then it executes the Exit Sub statement before reaching the end of the If structure. I could have put in an Else structure instead but was just typing code and already had the message box for one bookmark done.
-
WSeman
AskWoody Lounger
-
-
-
-
Viewing 2 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Windows 11 Insider Preview build 27842 released to Canary
by
joep517
3 minutes ago -
Quick Fix for Slowing File Explorer
by
Drcard:))
15 minutes ago -
WuMgr not loading?
by
LHiggins
51 minutes ago -
Word crashes when accessing Help
by
CWBillow
3 hours, 56 minutes ago -
New Microsoft Nag — Danger! Danger! sign-in to your Microsoft Account
by
EricB
7 hours, 42 minutes ago -
Blank Inetpub folder
by
Susan Bradley
8 hours, 33 minutes ago -
Google : Extended Repair Program for Pixel 7a
by
Alex5723
10 hours, 25 minutes ago -
Updates seem to have broken Microsoft Edge
by
rebop2020
6 minutes ago -
Wait command?
by
CWBillow
3 hours, 41 minutes ago -
Malwarebytes 5 Free version manual platform updates
by
Bob99
17 hours, 4 minutes ago -
inetpub : Microsoft’s patch for CVE-2025–21204 introduces vulnerability
by
Alex5723
23 hours, 40 minutes ago -
Windows 10 finally gets fix
by
Susan Bradley
1 day, 8 hours ago -
AMD Ryzen™ Chipset Driver Release Notes 7.04.09.545
by
Alex5723
1 day, 9 hours ago -
Win 7 MS Essentials suddenly not showing number of items scanned.
by
Oldtimer
1 day, 4 hours ago -
France : A law requiring messaging apps to implement a backdoor ..
by
Alex5723
1 day, 22 hours ago -
Dev runs Windows 11 ARM on an iPad Air M2
by
Alex5723
1 day, 23 hours ago -
MS-DEFCON 3: Cleanup time
by
Susan Bradley
18 hours, 46 minutes ago -
KB5056686 (.NET v8.0.15) Delivered Twice in April 2025
by
lmacri
5 hours, 3 minutes ago -
How to enable Extended Security Maintenance on Ubuntu 20.04 LTS before it dies
by
Alex5723
2 days, 11 hours ago -
Windows 11 Insider Preview build 26200.5562 released to DEV
by
joep517
2 days, 14 hours ago -
Windows 11 Insider Preview build 26120.3872 (24H2) released to BETA
by
joep517
2 days, 15 hours ago -
Unable to eject external hard drives
by
Robertos42
1 day, 1 hour ago -
Saying goodbye to not-so-great technology
by
Susan Bradley
13 hours, 11 minutes ago -
Tech I don’t miss, and some I do
by
Will Fastie
11 hours, 5 minutes ago -
Synology limits hard drives
by
Susan Bradley
3 days, 19 hours ago -
Links from Microsoft 365 and from WhatsApp not working
by
rog7
2 days, 21 hours ago -
WhatsApp Security Advisories CVE-2025-30401
by
Alex5723
4 days, 1 hour ago -
Upgrade Sequence
by
doneager
3 days, 18 hours ago -
Chrome extensions with 6 million installs have hidden tracking code
by
Nibbled To Death By Ducks
2 days ago -
Uninstall “New Outlook” before installing 2024 Home & Business?
by
Tex265
2 days, 17 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.