ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Word Processing functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Inserts a table of contents in a Word Processing document.
Example
doc is Document
...
// Define the table of contents
toc is docTableOfContents
toc.WithPageNumber = True
toc.StylesPerLevel[1] = styleTOCDefault1
toc.StylesPerLevel[2]= styleTOCDefault2 + CR + "MySubHeading"
toc.StylesPerLevel[3]= "MySubSubHeading"
 
// Insert table of contents at the beginning of the document
fDocBeginning is docFragment = doc[1 ON 0]
DocInsertTableOfContents(fDocBeginning, toc)
doc is Document
...
 
// Insert an automatic table of contents
// (3 levels of headings are taken into account)
DocInsertTableOfContents(doc[1 ON 0], 3)
Syntax

Inserting an automatic table of contents Hide the details

<Result> = DocInsertTableOfContents(<Fragment> [, <Number of levels>])
<Result>: docFragment variable
docFragment variable with the inserted fragment.
<Fragment>: docFragment variable
Name of the docFragment variable to be used. The content of this fragment will be replaced with the automatic table of contents.
<Number of levels>: Optional integer
Number of levels (between 1 and 9). This number corresponds to the number of levels of headings taken into account (Heading 1, Heading 2, etc.). The default value is 2.

Inserting a table of contents defined via a docTableOfContents variable Hide the details

<Result> = DocInsertTableOfContents(<Fragment> , <Table of contents>)
<Result>: docFragment variable
docFragment variable with the inserted fragment.
<Fragment>: docFragment variable
Name of the docFragment variable to be used. The content of this fragment will be replaced with the table of contents.
<Table of contents>: docTableOfContents variable
Name of the docTableOfContents variable that replaces the specified fragment.
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/31/2022

Send a report | Local help