# DocumentController.Load Method

> Loads a document from a file that is used for further processing.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 15.0
- **Namespace:** `TXTextControl.DocumentServer`
- **Package:** `TXTextControl.TextControl.WPF.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 for WPF > Reference > TXTextControl.DocumentServer > DocumentController.Load Method
- **443 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/documentcontroller/load-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/documentcontroller/load-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/documentcontroller/load-method/llms-full.txt

---

### Description

Loads a document from a file that is used for further processing.

### Syntax

```csharp
public void Load(string filename, FileFormat documentFormat);
```

```vbnet
Public Sub Load(filename As String, documentFormat As FileFormat)
```

### Parameters

| Parameter | Description |
|---|---|
| filename | Specifies the document file to be loaded. |
| documentFormat | Specifies one of the DocumentServer.FileFormat values. |

### Return Value

Returns true, if the document was loaded successfully and false, if the document is invalid or could not be loaded properly.

### Examples

The following example loads document content in a specified format. The created object is then available to the surrounding document workflow.

```csharp
documentController.Load("document.docx", TXTextControl.DocumentServer.FileFormat.MSWord);
Console.WriteLine("Document Controller is ready for use.");
```

```vbnet
documentController.Load("document.docx", TXTextControl.DocumentServer.FileFormat.MSWord)
Console.WriteLine("Document Controller is ready for use.")
```

---

## Nearby

- **Previous:** [DocumentController.GetFieldNames Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/documentcontroller/getfieldnames-method/llms-full.txt)
- **Next:** [DocumentController.LoadFromMemory Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver/documentcontroller/loadfrommemory-method/llms-full.txt)
