# TextControl.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 Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 14.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Windows.Forms.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > TextControl.Append Method
- **3777 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/append-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/append-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/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(AppendSettings)

Opens a file open dialogbox and appends the selected file to the existing document.

```csharp
public System.Windows.Forms.DialogResult Append(AppendSettings appendSettings);
```

```vbnet
Public Function Append(appendSettings As AppendSettings) As System.Windows.Forms.DialogResult
```

| Parameter | Description |
|---|---|
| appendSettings | Specifies settings on how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/appendsettings/enumeration/llms-full.txt) values. |

#### Append(StreamType, AppendSettings)

Opens a file open dialogbox and appends the selected file with the specified format to the existing document.

```csharp
public System.Windows.Forms.DialogResult Append(StreamType streamType, AppendSettings appendSettings);
```

```vbnet
Public Function Append(streamType As StreamType, appendSettings As AppendSettings) As System.Windows.Forms.DialogResult
```

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

#### 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-winforms/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |
| appendSettings | Specifies settings on how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/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-winforms/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |
| appendSettings | Specifies settings on how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/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-winforms/reference/txtextcontrol/binarystreamtype/enumeration/llms-full.txt) values. |
| appendSettings | Specifies settings on how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/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-winforms/reference/txtextcontrol/stringstreamtype/enumeration/llms-full.txt) values. |
| appendSettings | Specifies settings on how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/appendsettings/enumeration/llms-full.txt) values. |

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

Opens a file open dialogbox and appends the selected file with the specified format and special settings to the existing document.

```csharp
public System.Windows.Forms.DialogResult Append(StreamType streamType, LoadSettings loadSettings, AppendSettings appendSettings);
```

```vbnet
Public Function Append(streamType As StreamType, loadSettings As LoadSettings, appendSettings As AppendSettings) As System.Windows.Forms.DialogResult
```

| Parameter | Description |
|---|---|
| streamType | Specifies one of the [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |
| loadSettings | Specifies a [LoadSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/llms-full.txt) object with additional information and settings for the load operation. |
| appendSettings | Specifies settings on how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/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-winforms/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |
| loadSettings | Specifies a [LoadSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/llms-full.txt) object with additional information and settings for the load operation. |
| appendSettings | Specifies settings on how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/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-winforms/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |
| loadSettings | Specifies a [LoadSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/llms-full.txt) object with additional information and settings for the load operation. |
| appendSettings | Specifies settings on how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/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-winforms/reference/txtextcontrol/stringstreamtype/enumeration/llms-full.txt) values. |
| loadSettings | Specifies a [LoadSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/loadsettings/llms-full.txt) object with additional information and settings for the load operation. |
| appendSettings | Specifies settings on how the document is appended. It can be one of the [AppendSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/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)
```

### Return Value

The implementations that open a dialog box return the dialog's result value.

### 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("Text Control is ready for use.");
```

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

---

## Nearby

- **Previous:** [TextControl.AllowUndo Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/allowundo-property/llms-full.txt)
- **Next:** [TextControl.ApplicationFields Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/applicationfields-property/llms-full.txt)
