# HeaderFooter.GetTextFields Method

> Returns a collection containing text fields of the specified types.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 24.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.GetTextFields Method
- **652 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfooter/gettextfields-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfooter/gettextfields-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfooter/gettextfields-method/llms-full.txt

---

### Description

Returns a collection containing text fields of the specified types.

### Syntax

```csharp
public TextFieldCollection GetTextFields(TextFieldType fieldType);
```

```vbnet
Public Function GetTextFields(fieldType As TextFieldType) As TextFieldCollection
```

### Parameters

| Parameter | Description |
|---|---|
| fieldType | Specifies types of text fields. It can be a combination of the [TextFieldType](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textfieldtype/enumeration/llms-full.txt) values. |

### Return Value

The return value is a collection of all fields of the specified types.

### Examples

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

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

var result = headerFooter.GetTextFields(TextFieldType.HypertextLink);
Console.WriteLine($"Get Text Fields result: {result}");
```

```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"

Dim result = headerFooter.GetTextFields(TextFieldType.HypertextLink)
Console.WriteLine($"Get Text Fields result: {result}")
```

---

## Nearby

- **Previous:** [HeaderFooter.Frames Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfooter/frames-property/llms-full.txt)
- **Next:** [HeaderFooter.HypertextLinks Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/headerfooter/hypertextlinks-property/llms-full.txt)
