Next Tablesof Contents

C

Chuck

How can I Select the Range of the next TablesofContents
in a Document without refering to that TablesofContents
by its index number?

Thanks for any help
 
D

Doug Robbins

Maybe this will do what you want:

Dim myrange As Range, i As Long
Set myrange = ActiveDocument.Range
myrange.Start = Selection.Range.Start
For i = 1 To myrange.Fields.Count
If myrange.Fields(i).Type = wdFieldTOC Then
'Do what you want to the Table of Contents
Exit For
End If
Next i

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top