Share via

Need A Macro - List All Bookmarks, Text and Page

Anonymous
2024-02-10T20:41:55+00:00

Hi, In Word I could use a macro that will list all the bookmarked text in my document, as well as the page the bookmark appears, and it would be nice if the macro would hyperlink the text to the bookmarked location. TIA

Microsoft 365 and Office | Word | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2024-03-02T10:27:17+00:00

Sub ScratchMacro() 'A basic Word Macro coded by Gregory K. Maxey Dim oRng As Range Dim oBM As Bookmark If MsgBox("Is the cursor at the point you want to create you BM list?", vbQuestion + vbYesNo, "LIST LOCATION") = vbYes Then Set oRng = Selection.Range oRng.Collapse wdCollapseEnd For Each oBM In ActiveDocument.Bookmarks oRng.InsertAfter vbCr & oBM.Name Set oRng = ActiveDocument.Hyperlinks.Add(oRng.Paragraphs.Last.Range, , oBM.Name, , oBM.Range.Text).Range oRng.InsertAfter " " & oBM.Range.Information(wdActiveEndPageNumber) oRng.Collapse wdCollapseEnd Next Else MsgBox "Put the cursor where you want the BM List to appear and try again" End If lbl_Exit: Exit Sub End Sub

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Charles Kenyon 167.8K Reputation points Volunteer Moderator
    2024-02-11T17:00:37+00:00

    Despite what George said, you will probably find someone here kind enough to write such a macro for you.

    You will not, I think, find such a person on Stack Overflow. That site discourages people asking others to do their work for them.

    I do encourage you to start creating your own macros and asking for help with ones that need tweaking. Here are some additional resources:

    http://office.microsoft.com/en-gb/word-help/about-macros-HP005189421.aspx?CTT=1

    http://office.microsoft.com/en-gb/word-help/create-a-macro-HP005189420.aspx?CTT=1

    You may want to look at:
    Creating a macro with no programming experience using the recorder

    For installation instructions, see:

    The first one is quite comprehensive and dates back to the menu versions of Word. The second one may be easier for neophytes but does not cover as much.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2024-02-11T14:40:33+00:00

    Hi EC,

    Thanks for posting in the community.

    Based on my search, you can try the VBA code in **macropod'**s reply to highlight all bookmarks. Check if it helps.

    Since the situation you mentioned is related to VBA code, you can refer to this article: Office VBA support and feedback | Microsoft Docs to go to Stack Overflow by using the VBA tag, along with any other relevant tags as there are also many experienced engineers and experts in the forums there.

    Disclaimer: Microsoft provides no assurances and/or warranties, implied or otherwise, and is not responsible for the information you receive from the third-party linked sites, or any support related to technology.

    At the same time, we will also keep this thread open, so other Community members and Experts can also share their suggestions and inputs.

    Thank you for your cooperation and understanding!

    Sincerely,

    George | Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments