addTableContents
- addBackgroundImage
- addFooter
- addHeader
- addLineNumbering
- addPageBorders
- addProperties
- addSection
- createDocx
- createCharacterStyle
- createListStyle
- createParagraphStyle
- docxSettings
- importHeadersAndFooters
- importStyles
- modifyPageLayout
- removeFooters
- removeHeaders
- setBackgroundColor
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- setLanguage
- setMarkAsFinal
- setRTL
- addBookmark
- addBreak
- addChart
- addComment
- addCrossReference
- addDateAndHour
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addPageNumber
- addShape
- addSimpleField
- addStructuredDocumentTag
- addTable
- addTableContents
- addText
- addTextBox
- addWordML
- embedHTML
- clearBlocks
- deleteTemplateBlock
- getTemplateVariables
- modifyInputFields
- processTemplate
- removeTemplateVariable
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHtml
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- tickCheckbox
addTableContents

Inserts a Table of Contents (TOC) into the Word document.
Description
public void addTableContents(OptionsTableContents options, WordFragment legend)
public void addTableContents(OptionsTableContents options, WordFragment legend, String stylesTOC)
This method allows you to include a Table of Contents in you Word document.
Parameters
options
Option | Type | Description |
---|---|---|
autoUpdate | Boolean | If true it will try to update the TOC when first opened. |
displayLevels | String | Must be of the form "1-3" where the first number is the start level an the second the end level. If not defined all existing levels are shown. |
legend
Key | Type | Description |
---|---|---|
legend | WordFragment | The placeholder text that will be shown if the autoupdate option is not activated. |
stylesTOC
Key | Type | Description |
---|---|---|
stylesTOC | String | Path to a DOCX. This optional parameter allows to extract the TOC styles from an existing Word document so the embedded TOC can be fully customized. |
Code samples
Example #1