View Single Post
 
Old 05-01-2018, 09:50 AM
slaycock slaycock is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Sep 2013
Posts: 256
slaycock is on a distinguished road
Default

The result of a toc field will contain a collection of fields which are the hyperlinks and page references of the TOC.

e.g.
<expression returning a range>.field(<field_index>).result.fields.count

or in the terms of the last code example
oRng.fields.count

Therefore you can iterate though this collection and obtain the hyperlinks and pagerefs at your leisure without having to convert the toc to a table.

Dim myField as word.field

For each myField in oRng.Fields
if myField.type = wdfieldhyperlink then
' do something

etc etc
Reply With Quote