# DocumentController.TextComponent Property

> Gets or sets the object of type ServerTextControl that is associated with the DocumentController component. Invoking one of the DocumentController's instance methods will result in an exception being thrown, if the TextComponent property is left unset.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 15.0
- **Namespace:** `TXTextControl.DocumentServer`
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.DocumentServer > DocumentController.TextComponent Property
- **782 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/documentcontroller/textcomponent-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/documentcontroller/textcomponent-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/documentcontroller/textcomponent-property/llms-full.txt

---

### Description

Gets or sets the object of type [ServerTextControl](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/llms-full.txt) that is associated with the DocumentController component. Invoking one of the DocumentController's instance methods will result in an exception being thrown, if the TextComponent property is left unset.

### Syntax

```csharp
public Component TextComponent { get; set; }
```

```vbnet
Public Property TextComponent As Component
```

### Examples

The following example creates a new [DocumentServer.DocumentController](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/documentcontroller/llms-full.txt) object and associates a [ServerTextControl](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/servertextcontrol/llms-full.txt) with it:

```csharp
TXTextControl.DocumentController documentController1 = new TXTextControl.DocumentController();
TXTextControl.ServerTextControl serverTextControl1 = new TXTextControl.ServerTextControl();

documentController1.TextComponent = serverTextControl1;
```

```vbnet
Dim DocumentController1 As TXTextControl.DocumentController = New TXTextControl.DocumentController
Dim ServerTextControl1 As TXTextControl.ServerTextControl = New TXTextControl.ServerTextControl

DocumentController1.TextComponent = ServerTextControl1
```

The following example uses `DocumentController.TextComponent` to configure text component as part of the document controller workflow. The configured value is checked before the workflow continues.

```csharp
documentController.TextComponent = new System.ComponentModel.Component();
if (documentController.TextComponent != null)
{
    Console.WriteLine("Document Controller: Text Component is available.");
}
```

```vbnet
documentController.TextComponent = New System.ComponentModel.Component()
If documentController.TextComponent IsNot Nothing Then
    Console.WriteLine("Document Controller: Text Component is available.")
End If
```

---

## Nearby

- **Previous:** [DocumentController.SaveToMemory Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/documentcontroller/savetomemory-method/llms-full.txt)
- **Next:** [DocumentController.Twips2Pixels Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver/documentcontroller/twips2pixels-method/llms-full.txt)
