# HeaderFooter.DocumentTargets Property

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

- **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 > HeaderFooter.DocumentTargets Property
- **605 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfooter/documenttargets-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfooter/documenttargets-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfooter/documenttargets-property/llms-full.txt

---

### Description

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

### Syntax

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

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

### Examples

The following example creates a header for the first section and configures its content or layout by using `HeaderFooter.DocumentTargets`.

```csharp
HeaderFooterCollection headers = textControl.Sections[1].HeadersAndFooters;
headers.Add(HeaderFooterType.Header);
HeaderFooter headerFooter = headers.GetItem(HeaderFooterType.Header);
headerFooter.Selection.Text = "Quarterly report";

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

```vbnet
Dim headers As HeaderFooterCollection = textControl.Sections(1).HeadersAndFooters
headers.Add(HeaderFooterType.Header)
Dim headerFooter As HeaderFooter = headers.GetItem(HeaderFooterType.Header)
headerFooter.Selection.Text = "Quarterly report"

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

### Limitations

Read only.

---

## Nearby

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