# ServerTextControl.Append Method

> Loads text in a certain format from a file, a byte array or a string and appends it to the existing document.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 14.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.Server.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Server.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > ServerTextControl.Append Method
- **2847 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/append-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/append-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/append-method/llms-full.txt

---

### Description

Loads text in a certain format from a file, a byte array or a string and appends it to the existing document.

### Syntax

#### Append(string, StreamType, AppendSettings)

Loads text with the specified format from the specified file and appends it to the existing document.

```csharp
public void Append(string path, StreamType streamType, AppendSettings appendSettings);
```

```vbnet
Public Sub Append(path As String, streamType As StreamType, appendSettings As AppendSettings)
```

| Parameter | Description |
|---|---|
| path | Specifies a file from which the data is loaded. |
| streamType | Specifies one of the [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |
| appendSettings | Specifies settings how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/appendsettings/enumeration/llms-full.txt) values. |

#### Append(FileStream, StreamType, AppendSettings)

Loads text with the specified format from the specified file stream and appends it to the existing document.

```csharp
public void Append(FileStream fileStream, StreamType streamType, AppendSettings appendSettings);
```

```vbnet
Public Sub Append(fileStream As FileStream, streamType As StreamType, appendSettings As AppendSettings)
```

| Parameter | Description |
|---|---|
| fileStream | Specifies a file from which the data is loaded. The data is loaded from the stream's current position. |
| streamType | Specifies one of the [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |
| appendSettings | Specifies settings how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/appendsettings/enumeration/llms-full.txt) values. |

#### Append(byte\[\], BinaryStreamType, AppendSettings)

Loads text with the specified format from the specified byte array and appends it to the existing document.

```csharp
public void Append(byte[] binaryData, BinaryStreamType binaryStreamType, AppendSettings appendSettings);
```

```vbnet
Public Sub Append(binaryData As Byte(), binaryStreamType As BinaryStreamType, appendSettings As AppendSettings)
```

| Parameter | Description |
|---|---|
| binaryData | Specifies a byte array from which the data is loaded. |
| binaryStreamType | Specifies one of the [BinaryStreamType](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/binarystreamtype/enumeration/llms-full.txt) values. |
| appendSettings | Specifies settings how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/appendsettings/enumeration/llms-full.txt) values. |

#### Append(string, StringStreamType, AppendSettings)

Loads text with the specified format from the specified string and appends it to the existing document.

```csharp
public void Append(string stringData, StringStreamType stringStreamType, AppendSettings appendSettings);
```

```vbnet
Public Sub Append(stringData As String, stringStreamType As StringStreamType, appendSettings As AppendSettings)
```

| Parameter | Description |
|---|---|
| stringData | Specifies a string from which the data is loaded. |
| stringStreamType | Specifies one of the [StringStreamType](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/stringstreamtype/enumeration/llms-full.txt) values. |
| appendSettings | Specifies settings how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/appendsettings/enumeration/llms-full.txt) values. |

#### Append(string, StreamType, LoadSettings, AppendSettings)

Loads text with the specified format and special settings from the specified file and appends it to the existing document.

```csharp
public void Append(string path, StreamType streamType, LoadSettings loadSettings, AppendSettings appendSettings);
```

```vbnet
Public Sub Append(path As String, streamType As StreamType, loadSettings As LoadSettings, appendSettings As AppendSettings)
```

| Parameter | Description |
|---|---|
| path | Specifies a file from which the data is loaded. |
| streamType | Specifies one of the [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |
| loadSettings | Specifies a [LoadSettings](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/loadsettings/llms-full.txt) object with additional information and settings for the load operation. |
| appendSettings | Specifies settings how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/appendsettings/enumeration/llms-full.txt) values. |

#### Append(FileStream, StreamType, LoadSettings, AppendSettings)

Loads text with the specified format and special settings from the specified file stream and appends it to the existing document.

```csharp
public void Append(FileStream fileStream, StreamType streamType, LoadSettings loadSettings, AppendSettings appendSettings);
```

```vbnet
Public Sub Append(fileStream As FileStream, streamType As StreamType, loadSettings As LoadSettings, appendSettings As AppendSettings)
```

| Parameter | Description |
|---|---|
| fileStream | Specifies a file from which the data is loaded. The data is loaded from the stream's current position. |
| streamType | Specifies one of the [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |
| loadSettings | Specifies a [LoadSettings](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/loadsettings/llms-full.txt) object with additional information and settings for the load operation. |
| appendSettings | Specifies settings how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/appendsettings/enumeration/llms-full.txt) values. |

#### Append(string, StringStreamType, LoadSettings, AppendSettings)

Loads text with the specified format and special settings from the specified string and appends it to the existing document.

```csharp
public void Append(string stringData, StringStreamType stringStreamType, LoadSettings loadSettings, AppendSettings appendSettings);
```

```vbnet
Public Sub Append(stringData As String, stringStreamType As StringStreamType, loadSettings As LoadSettings, appendSettings As AppendSettings)
```

| Parameter | Description |
|---|---|
| stringData | Specifies a string from which the data is loaded. |
| stringStreamType | Specifies one of the [StringStreamType](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/stringstreamtype/enumeration/llms-full.txt) values. |
| loadSettings | Specifies a [LoadSettings](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/loadsettings/llms-full.txt) object with additional information and settings for the load operation. |
| appendSettings | Specifies settings how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/appendsettings/enumeration/llms-full.txt) values. |

#### Append(byte\[\], BinaryStreamType, LoadSettings, AppendSettings)

```csharp
public void Append(byte[] binaryData, BinaryStreamType binaryStreamType, LoadSettings loadSettings, AppendSettings appendSettings);
```

```vbnet
Public Sub Append(binaryData As Byte(), binaryStreamType As BinaryStreamType, loadSettings As LoadSettings, appendSettings As AppendSettings)
```

### Examples

The following example appends formatted text to the existing document. The created object is then available to the surrounding document workflow.

```csharp
textControl.Append(@"{\rtf1\ansi Sample document}", StringStreamType.RichTextFormat, AppendSettings.StartWithNewParagraph);
Console.WriteLine("Server Text Control is ready for use.");
```

```vbnet
textControl.Append("{\rtf1\ansi Sample document}", StringStreamType.RichTextFormat, AppendSettings.StartWithNewParagraph)
Console.WriteLine("Server Text Control is ready for use.")
```

---

## Nearby

- **Previous:** [ServerTextControl.AdaptFont Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/adaptfont-event/llms-full.txt)
- **Next:** [ServerTextControl.ApplicationFields Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/applicationfields-property/llms-full.txt)
