# TextPart Class

> The Web.TextPart class implements the Web.IFormattedText interface as well as public properties and internal functionality common to all text parts in a TX Text Control document. The following classes inherit from this class: Web.MainText, Web.HeaderFooter and Web.TextFrame.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 22.0
- **Namespace:** `TXTextControl.Web`
- **Package:** `TXTextControl.Web` (assembly `TXTextControl.Web.DocumentEditor.dll`, from nuget.org, the private NuGet feed or Text Control Offline Packages)
- **Implements:** `TXTextControl.Web.IFormattedText`
- **Derived:** `TXTextControl.Web.HeaderFooter`, `TXTextControl.Web.MainText`, `TXTextControl.Web.TextFrame`
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.Web > TextPart Class
- **459 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textpart/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textpart/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textpart/llms-full.txt

---

### Description

The Web.TextPart class implements the [Web.IFormattedText](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/iformattedtext/llms-full.txt) interface as well as public properties and internal functionality common to all text parts in a TX Text Control document. The following classes inherit from this class: [Web.MainText](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/maintext/llms-full.txt), [Web.HeaderFooter](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/headerfooter/llms-full.txt) and [Web.TextFrame](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textframe/llms-full.txt).

### Syntax

```csharp
public class TextPart : IFormattedText
```

```vbnet
Public Class TextPart
    Implements IFormattedText
```

### Examples

The following example inspects a Text Part object supplied by the document workflow.

```csharp
var currentValue = textPart.Selection;
Console.WriteLine($"Selection: {currentValue}");
```

```vbnet
Dim currentValue = textPart.Selection
Console.WriteLine($"Selection: {currentValue}")
```

---

## In This Section

- [TextPart.Selection Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textpart/selection-property/llms-full.txt): Gets or sets the current selection in a text part. The property value is an object of the type Web.Selection. For more information see the description of the Web.Selection class.

---

## Nearby

- **Previous:** [TextFrame Class](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textframe/llms-full.txt)
- **Next:** [TextPart.Selection Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textpart/selection-property/llms-full.txt)
