# IFormattedText.DocumentTargets Property

> Gets a collection of all targets in the text part. The property value is an object of the type DocumentTargetCollection.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 23.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.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 WPF > Reference > TXTextControl > IFormattedText.DocumentTargets Property
- **458 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/documenttargets-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/documenttargets-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/documenttargets-property/llms-full.txt

---

### Description

Gets a collection of all targets in the text part. The property value is an object of the type [DocumentTargetCollection](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documenttargetcollection/llms-full.txt).

### Syntax

```csharp
DocumentTargetCollection DocumentTargets { get; }
```

```vbnet
ReadOnly Property DocumentTargets As DocumentTargetCollection
```

### Examples

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

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

foreach (DocumentTarget documentTarget in iFormattedText.DocumentTargets)
{
    documentTarget.Name = "CustomerName";
}
```

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

For Each documentTarget As DocumentTarget In iFormattedText.DocumentTargets
    documentTarget.Name = "CustomerName"
Next
```

### Limitations

Read only.

---

## Nearby

- **Previous:** [IFormattedText.DocumentLinks Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/documentlinks-property/llms-full.txt)
- **Next:** [IFormattedText.Drawings Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/drawings-property/llms-full.txt)
