# TableOfContentsDialog Method

> Opens the built-in dialog box for inserting a new table of contents or changing the one at the input position and returns its identifier or 0.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Text Control ActiveX > API Reference > TXTextControl > TableOfContentsDialog Method
- **201 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/tableofcontentsdialog-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/tableofcontentsdialog-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/tableofcontentsdialog-method/llms-full.txt

---

Invokes the built-in dialog box for inserting or changing a table of contents. If the current text input position is in an existing table of contents, the dialog box shows its attributes and the user can change it. Otherwise, a new table of contents is inserted with the specified attributes.

Introduced: 29.0.

### Syntax

```vbscript
TXTextControl.TableOfContentsDialog
```

### Return Value

The method returns the unique identifier of the changed or inserted table of contents. The method returns 0, if the dialog box has been left with Cancel or the table of contents is empty because no entry has been found in the document.

### Data Types

| Name | Data type |
|---|---|
| Return value | Long |

### See Also

- [Programming Category: Using a Table of Contents](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/table-of-contents/llms-full.txt)
- [Programming Category: Built-in Dialog Boxes](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/dialog-boxes/llms-full.txt)

---

## Nearby

- **Previous:** [TableOfContentsDeleted Event](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/tableofcontentsdeleted-event/llms-full.txt)
- **Next:** [TableOfContentsEntered Event](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/tableofcontentsentered-event/llms-full.txt)
