# TextControl.TextParts Property

> Gets a collection of all main text parts the current document contains. The property's value is an object of the type TextPartCollection. The main text parts are the main text, text frames and headers and footers.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 16.0
- **Namespace:** `TXTextControl.WPF`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.WPF.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.WPF > TextControl.TextParts Property
- **345 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/textparts-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/textparts-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/textparts-property/llms-full.txt

---

### Description

Gets a collection of all main text parts the current document contains. The property's value is an object of the type [TextPartCollection](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textpartcollection/llms-full.txt). The main text parts are the main text, text frames and headers and footers.

### Syntax

```csharp
public TextPartCollection TextParts { get; }
```

```vbnet
Public ReadOnly Property TextParts As TextPartCollection
```

### Examples

The following example iterates through the text parts collection and processes each object.

```csharp
foreach (object item in textControl.TextParts)
{
    Console.WriteLine(item);
}
```

```vbnet
For Each item As Object In textControl.TextParts
    Console.WriteLine(item)
Next
```

### Limitations

Runtime only.

Read only.

---

## Nearby

- **Previous:** [TextControl.TextMiniToolbarInitialized Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/textminitoolbarinitialized-event/llms-full.txt)
- **Next:** [TextControl.TrackedChangeChanged Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/trackedchangechanged-event/llms-full.txt)
