# ServerTextControl.DocumentTargets Property

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

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

---

### Description

Gets a collection of all targets in the document. 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
public DocumentTargetCollection DocumentTargets { get; }
```

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

### Examples

The following example iterates through the document targets collection and processes each document target.

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

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

### Limitations

Runtime only.

Read only.

---

## Nearby

- **Previous:** [ServerTextControl.DocumentTargetDeleted Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/documenttargetdeleted-event/llms-full.txt)
- **Next:** [ServerTextControl.DrawingCreated Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/drawingcreated-event/llms-full.txt)
