How to generate a Table of Contents?
Posted: Mon Mar 15, 2010 7:42 pm
I am generating a compound document with several sections and I require a Table of Contents (TOC) with the starting page number of each section. I generate each section as a RichViewEdit (RVE) then append the sections together into an overall RVE.
Currently, I am making note of the length in pages of each section and adding them up as I generate my report. This only works as long as each section starts on a new page. However, I want to allow my user to flow one section into the next without a page break.
I'm guessing that the way to do the TOC is to insert Checkpoints before appending each section to the overall RVE, then visit each Checkpoint (without actually displaying them - how?) and make note of the current page number (how to determine?) for each section. Finally, re-build the entire report, with the correct page numbers in the TOC.
If this is the right approach, then my questions are:
1. How to "visit" each checkpoint without displaying them (OnCheckpointVisible is not supported in RVE, according to the Help file)?
2. How to determine the current page number where each checkpoint lands?
Thanks,
Jeff Allan
Currently, I am making note of the length in pages of each section and adding them up as I generate my report. This only works as long as each section starts on a new page. However, I want to allow my user to flow one section into the next without a page break.
I'm guessing that the way to do the TOC is to insert Checkpoints before appending each section to the overall RVE, then visit each Checkpoint (without actually displaying them - how?) and make note of the current page number (how to determine?) for each section. Finally, re-build the entire report, with the correct page numbers in the TOC.
If this is the right approach, then my questions are:
1. How to "visit" each checkpoint without displaying them (OnCheckpointVisible is not supported in RVE, according to the Help file)?
2. How to determine the current page number where each checkpoint lands?
Thanks,
Jeff Allan