# TextFrame.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 > TextFrame.GetTextFields Method
- **515 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textframe/gettextfields-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textframe/gettextfields-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textframe/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 applies bold formatting through the text frame's selection by using `TextFrame.get_TextFields`.

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

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

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

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

---

## Nearby

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