# TableOfContents.Update Method

> Updates the content and the page numbers of the table of contents.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 29.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > TableOfContents.Update Method
- **495 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/tableofcontents/update-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/tableofcontents/update-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/tableofcontents/update-method/llms-full.txt

---

### Description

Updates the content and the page numbers of the table of contents.

### Syntax

```csharp
public TableOfContentsCollection.AddResult Update();
```

```vbnet
Public Function Update() As TableOfContentsCollection.AddResult
```

### Return Value

The return value specifies whether the new table of contents has successfully been updated. It can be one of the [TableOfContentsCollection.AddResult](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/tableofcontentscollection/addresult-enumeration/llms-full.txt) values.

### Examples

The following example creates a table of contents for the document's heading styles by using `TableOfContents.Update`.

```csharp
TableOfContents tableOfContents = new(1, 3) { Name = "Contents", ID = 10 };
textControl.TablesOfContents.Add(tableOfContents);

var result = tableOfContents.Update();
Console.WriteLine($"Update result: {result}");
```

```vbnet
Dim tableOfContents As New TableOfContents(1, 3) With { .Name = "Contents", .ID = 10 }
textControl.TablesOfContents.Add(tableOfContents)

Dim result = tableOfContents.Update()
Console.WriteLine($"Update result: {result}")
```

---

## Nearby

- **Previous:** [TableOfContents.Title Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/tableofcontents/title-property/llms-full.txt)
- **Next:** [TableOfContentsCollection Class](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/tableofcontentscollection/llms-full.txt)
