User`s guide
13 Create a Report Program
13-78
Create a Table of Contents
In this section...
“Create a Microsoft Word Table of Contents” on page 13-78
“Create an HTML Table of Contents” on page 13-80
“Set Outline Levels of Section Heads” on page 13-82
Create a Microsoft Word Table of Contents
The DOM API relies on an automatic table-of-contents (TOC) generation feature of Word
to generate a table of contents in a DOM Word report. With the Word TOC generation
feature, you create an item called a TOC reference in a Word document where you want
a TOC to appear. You create and set the outline line level of the paragraphs (typically
section heads) that you want to include in the generated TOC. Finally, you have Word
update the TOC to include the content of the paragraphs at the indicated outline level.
You use a very similar procedure for Word reports you create using the DOM API, except
that you create the section heads programmatically instead of interactively. To generate
a table of contents in a DOM Word report, perform these steps.
1
Create a table of contents reference in the Word template to specify where in the
report to generate the TOC. See “Create a Word Table of Contents Reference” on
page 13-78.
2
Set the outline levels of the section heads that you want to appear in the table of
contents. See “Set Outline Levels of Section Heads” on page 13-82.
3
Update the generated document. See “Update the TOC in a Word Report” on page
13-79.
Create a Word Table of Contents Reference
1
Open the template in Word.
2
Click where you want to create the table of contents.
3
In the Word ribbon, select the References pane.
4
Select the Table of Contents button.