Hello all
If your working in a a long document, and for ease of navigation you want to goto the Table of contents / index, does anyone know the shortcut key?
Many thanks in advance
diana
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » shortcut key to goto the table of contents (Word 2002 XP SR3)
Hi Diana,
Here’s a macro you could attach to a toolbar icon of keystroke combo to find a given TOC in a document:
Sub TOCFinder() Dim SBar As Boolean ' Status Bar flag Dim oFld As Field Dim i As Integer Dim j As Integer Dim k As Integer j = 0 ' Store current Status Bar status, then switch on SBar = Application.DisplayStatusBar Application.DisplayStatusBar = True ' get the TOC to find k = InputBox("Which TOC # do you want to go to?", "Table of Contents Selector") With ActiveDocument For i = 1 To .Fields.Count If .Fields(i).Type = wdFieldTOC Then j = j + 1 StatusBar = "TOC " & j & " of " & k & " found. Searching ..." If j = k Then StatusBar = "TOC " & k & " found." .Fields(i).Select With Selection .GoTo What:=wdGoToField, Count:=i .GoTo What:=wdGoToBookmark, Name:="page" End With Exit Sub End If End If Next i MsgBox "TOC " & k & " not found" End With ' Clear the Status Bar Application.StatusBar = False ' Restore original Status Bar status Application.DisplayStatusBar = SBar End Sub
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Here’s an alternative version of macropod’s macro that uses the built-in .TablesOfContents collection. (It may run quicker in a document with lots of other kinds of fields, although there may be a reason macropod avoided this approach, in which case I’m hoping he’ll weigh in on that issue.)
Sub TOCFinder() Dim i As Integer Dim intTOCCount As Integer With ActiveDocument intTOCCount = .TablesOfContents.Count Select Case intTOCCount Case 0 MsgBox "There are no tables of contents." Exit Sub Case 1 i = 1 Case Else i = InputBox("Which TOC # do you want to go to?", "TOCFinder") If i > intTOCCount Then MsgBox "There are only " & intTOCCount & " tables of contents." i = intTOCCount End If End Select .TablesOfContents(i).Range.Select With Selection .Collapse .MoveUp wdLine, 1 .MoveDown wdLine, 1 End With End With End Sub
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.
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.
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.
Notifications