Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-18-2016, 02:34 AM
dharker dharker is offline How to create a list of bookmarks? Windows 10 How to create a list of bookmarks? Office 2016
Novice
How to create a list of bookmarks?
 
Join Date: Oct 2016
Location: Ludlow, UK
Posts: 2
dharker is on a distinguished road
Default How to create a list of bookmarks?

Hi,



I'm new to this forum, and have a question I'm hoping you can help me with? I've a lengthy .DOCX document which is a software manual. I'd like to create a table/list of bookmarks at the beginning of the document, so that my support team can click on an issue (in the form of a bookmark) and go to that point in the manual, where they can then read out the solution.

I have the bookmarks created, I now need a means of creating a list of them so that they can be clicked on to hyperlink to the correct location.

Many thanks in anticipation,

David
Reply With Quote
  #2  
Old 10-18-2016, 04:06 AM
gmayor's Avatar
gmayor gmayor is offline How to create a list of bookmarks? Windows 10 How to create a list of bookmarks? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The following should do the trick.

Code:
Option Explicit

Sub AddBookmarkList()
Dim oBM As Bookmark
Dim oTable As Table
Dim i As Long
Dim oRng As Range
    Set oRng = ActiveDocument.Range(0, 0)
    Set oTable = oRng.Tables.Add(oRng, 1, 1)
    For i = 1 To ActiveDocument.Bookmarks.Count
        Set oBM = ActiveDocument.Bookmarks(i)
        ActiveDocument.Hyperlinks.Add _
                Anchor:=oTable.Cell(i, 1).Range, Address:="", _
                SubAddress:=oBM.Name, _
                ScreenTip:="", _
                TextToDisplay:="Goto Bookmarked Location " & oBM.Name
        If i < ActiveDocument.Bookmarks.Count Then
            oTable.Rows.Add
        End If
    Next i
lbl_Exit:
    Set oTable = Nothing
    Set oBM = Nothing
    Set oRng = Nothing
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 10-18-2016, 06:37 AM
dharker dharker is offline How to create a list of bookmarks? Windows 10 How to create a list of bookmarks? Office 2016
Novice
How to create a list of bookmarks?
 
Join Date: Oct 2016
Location: Ludlow, UK
Posts: 2
dharker is on a distinguished road
Default

Thanks Graham - works a treat!

David
Reply With Quote
  #4  
Old 10-19-2016, 12:17 AM
eNGiNe eNGiNe is offline How to create a list of bookmarks? Windows 7 32bit How to create a list of bookmarks? Office 2010 64bit
Expert
 
Join Date: Jan 2012
Location: Brussels [BE]
Posts: 746
eNGiNe is on a distinguished road
Default

Sounds rather like a table of contents, though I could be missing something …
Reply With Quote
  #5  
Old 10-19-2016, 07:05 AM
Charles Kenyon Charles Kenyon is offline How to create a list of bookmarks? Windows 8 How to create a list of bookmarks? Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,469
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Sounds like a Table of Contents to me, as well. That would be much easier since the feature is built-in.
Generating a Table of Contents - Complex Documents
How to create a table of contents in Microsoft Word by Shauna Kelly

(Just because you use the TOC feature does not mean that you have to call it a Table of Contents in your document.)
Reply With Quote
  #6  
Old 10-19-2016, 03:08 PM
macropod's Avatar
macropod macropod is offline How to create a list of bookmarks? Windows 7 64bit How to create a list of bookmarks? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,373
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

See also the code I posted at: https://social.msdn.microsoft.com/Fo...?forum=worddev . That code outputs both a table of bookmarks and a table of cross-references to them.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
bookmark list



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Index List Using Bookmarks in Alphabetical Order priteshp108 Word VBA 8 11-16-2015 12:06 PM
How to create a list of bookmarks? Form updating Bookmarks - writes to the bookmarks multiple times PeterPlys Word VBA 13 01-14-2015 06:41 AM
How to create a list of bookmarks? Macro to list all bookmarks Marrick13 Word VBA 4 02-09-2012 08:00 PM
How to fix "create bookmarks using headings" as default when saving to PDF using Word ghumdinger Word 0 05-05-2011 02:11 AM
How do you create a list similar to an itunes list? hatemail13 Excel 1 08-06-2010 02:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:50 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft