The Table of Contents dialog allows end-users to change the Table of Contents' appearance and preview the result.
End-users can right-click the table of contents and select the Edit Table of Contents... item in the context menu to invoke this dialog.
The table below describes the dialog's options and the TOC field switches used to achieve the required result:
Call the FieldCollection.Create method to insert a TOC field with the desired switches and create the table of contents in code. Refer to the How to: Create a Table of Contents in Code topic for an example.