Results 1 to 5 of 5
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    shortcut key to goto the table of contents (Word 2002 XP SR3)

    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 <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: shortcut key to goto the table of contents (Word 2002 XP SR3)

    There is no built-in shortcut key for this.

  3. #3
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: 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:

    <pre>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
    </pre>

    Cheers,

    Paul Edstein
    [MS MVP - Word]

  4. #4
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: shortcut key to goto the table of contents (Word 2002 XP SR3)

    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.)
    <pre>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</pre>


  5. #5
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: shortcut key to goto the table of contents (Word 2002 XP SR3)

    Hi Steve,
    <hr>there may be a reason macropod avoided this approach<hr>
    Amnesia <img src=/S/doze.gif border=0 alt=doze width=15 height=15>
    Cheers,

    Paul Edstein
    [MS MVP - Word]

Posting Permissions

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