# TextControl.DocumentTargets Property

> Gets a collection of all targets contained in the text part with the input focus. This can be the main text, a text frame or a header or footer. The property value is an object of the type DocumentTargetCollection.

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

---

### Description

Gets a collection of all targets contained in the text part with the input focus. This can be the main text, a text frame or a header or footer. The property value is an object of the type [DocumentTargetCollection](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/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.

### See Also

Text Fields and Hypertext Links - Hypertext Links.

---

## Nearby

- **Previous:** [TextControl.DocumentTargetMarkers Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/documenttargetmarkers-property/llms-full.txt)
- **Next:** [TextControl.DocumentToClient Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/documenttoclient-method/llms-full.txt)
