![]() |
|
#1
|
|||
|
|||
|
I need a macro that I can attach to a button on the QAT that sends me to the index. Is there such a macro out there somewhere? |
|
#2
|
|||
|
|||
|
Something like this perhaps:
Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oFld As Word.Field
For Each oFld In ActiveDocument.Range.Fields
If oFld.Type = wdFieldIndex Then
oFld.Select
End If
Exit For
Next oFld
End Sub
|
|
#3
|
|||
|
|||
|
Greg, Thanks for your reply. This didn't work. What I need is - wherever I am in a document, if I click the button in the QAT, it takes me to the index at the end of the document. I set this up and it does nothing when I click the macro icon.
|
|
#4
|
|||
|
|||
|
Phil,
I had the Exit For in the wrong place. Sorry: Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oFld As Word.Field
For Each oFld In ActiveDocument.Range.Fields
If oFld.Type = wdFieldIndex Then
oFld.Select
Exit For
End If
Next oFld
End Sub
|
|
#5
|
|||
|
|||
|
Or just a bookmark. That is kind of what they are good for. That way you are not iterating through possible fields.
|
|
| Tags |
| gotoindex macro, index, indexing in word |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Create index
|
gtpt | Word | 1 | 03-07-2014 07:34 PM |
| Need help with Index formula | gbaker | Excel | 7 | 02-07-2014 06:34 AM |
Formatting a second index
|
Lebber | Word | 3 | 08-05-2013 02:13 AM |
| Adding an Index | savo | Word | 1 | 04-17-2013 06:16 PM |
Index switches
|
cksm4 | Word VBA | 2 | 02-03-2011 07:21 AM |