# TextViewGenerator.BeginUndoAction Method

> Begins a user-defined undo operation. All editing and fomatting changes made between BeginUndoAction and EndUndoAction belong to the undo operation. These changes are undone or redone in a single step. The specified user-defined name is available with the UndoActionName property.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 23.0
- **Namespace:** `TXTextControl.ServerVisualisation`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Server.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.Server.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Server.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.ServerVisualization > TextViewGenerator.BeginUndoAction Method
- **565 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/beginundoaction-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/beginundoaction-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/beginundoaction-method/llms-full.txt

---

### Description

Begins a user-defined undo operation. All editing and fomatting changes made between BeginUndoAction and [EndUndoAction](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/endundoaction-method/llms-full.txt) belong to the undo operation. These changes are undone or redone in a single step. The specified user-defined name is available with the [UndoActionName](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/undoactionname-property/llms-full.txt) property.

### Syntax

```csharp
public void BeginUndoAction(string actionName);
```

```vbnet
Public Sub BeginUndoAction(actionName As String)
```

### Parameters

| Parameter | Description |
|---|---|
| actionName | Specifies the undo action's name. If an action name is not necessary, this parameter can be null or an empty string. |

### Examples

The following example applies bold formatting through the text view generator's selection by using `TextViewGenerator.BeginUndoAction`.

```csharp
Selection formattedSelection = textViewGenerator.Selection;
formattedSelection.Bold = true;
textViewGenerator.Selection = formattedSelection;

textViewGenerator.BeginUndoAction("CustomerName");
Console.WriteLine("Text View Generator is ready for use.");
```

```vbnet
Dim formattedSelection As Selection = textViewGenerator.Selection
formattedSelection.Bold = True
textViewGenerator.Selection = formattedSelection

textViewGenerator.BeginUndoAction("CustomerName")
Console.WriteLine("Text View Generator is ready for use.")
```

---

## Nearby

- **Previous:** [TextViewGenerator.BarcodeSelected Event](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/barcodeselected-event/llms-full.txt)
- **Next:** [TextViewGenerator.CanCharacterFormat Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-servervisualization/textviewgenerator/cancharacterformat-property/llms-full.txt)
