# IFormattedText.SubTextParts Property

> Gets a collection of all subtextparts in the text part. The property's value is an object of the type SubTextPartCollection.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 23.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.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 Server > Reference > TXTextControl > IFormattedText.SubTextParts Property
- **452 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/iformattedtext/subtextparts-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/iformattedtext/subtextparts-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/iformattedtext/subtextparts-property/llms-full.txt

---

### Description

Gets a collection of all subtextparts in the text part. The property's value is an object of the type [SubTextPartCollection](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/subtextpartcollection/llms-full.txt).

### Syntax

```csharp
SubTextPartCollection SubTextParts { get; }
```

```vbnet
ReadOnly Property SubTextParts As SubTextPartCollection
```

### Examples

The following example applies bold formatting through the iformatted text's selection by using `IFormattedText.SubTextParts`.

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

foreach (SubTextPart subTextPart in iFormattedText.SubTextParts)
{
    subTextPart.Name = "CustomerName";
}
```

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

For Each subTextPart As SubTextPart In iFormattedText.SubTextParts
    subTextPart.Name = "CustomerName"
Next
```

### Limitations

Read only.

---

## Nearby

- **Previous:** [IFormattedText.Selection Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/iformattedtext/selection-property/llms-full.txt)
- **Next:** [IFormattedText.Tables Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/iformattedtext/tables-property/llms-full.txt)
