View Single Post
 
Old 02-13-2021, 04:06 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,978
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Ahh, if that is what the poster meant then it is certainly more complicated than I would ever bother working with...

But I think it can still be done with nested ref codes in TC field. Say you bookmark the heading text with the bookmark name 'head1'. Then add a TC field where you want that section's pages to end (ie. in the last paragraph of that section)
{TC "{Ref head1 \n} {Ref head1} {PageRef head1}-{Page}" \l 1 \n}

Then build the TOC using the \f switch to bring in the TC fields.

This works as a concept and could be coded into a macro but it is so ungainly that it is easier to just build the actual tc text on the fly with a macro and forget trying to use the nested fields.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote