# TextControl.Save Method

> Saves the complete contents of a document with the specified format.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **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.Save Method
- **3671 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/save-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/save-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/save-method/llms-full.txt

---

### Description

Saves the complete contents of a document with the specified format.

### Syntax

#### Save()

Opens a file `Save As...` dialogbox and saves the complete contents of a document in a user-specified file.

```csharp
public System.Windows.Forms.DialogResult Save();
```

```vbnet
Public Function Save() As System.Windows.Forms.DialogResult
```

#### Save(StreamType)

Opens a file `Save As...` dialogbox and saves the complete contents of a document in a user-specified file. The dialogbox offers the specified file format filters.

```csharp
public System.Windows.Forms.DialogResult Save(StreamType streamType);
```

```vbnet
Public Function Save(streamType As StreamType) As System.Windows.Forms.DialogResult
```

| Parameter | Description |
|---|---|
| streamType | Specifies one or more of the [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |

#### Save(StreamType, SaveSettings)

Opens a file `Save As...` dialogbox and saves the complete contents of a document in a user-specified file with special settings. The dialogbox offers the specified file format filters.

```csharp
public System.Windows.Forms.DialogResult Save(StreamType streamType, SaveSettings saveSettings);
```

```vbnet
Public Function Save(streamType As StreamType, saveSettings As SaveSettings) As System.Windows.Forms.DialogResult
```

| Parameter | Description |
|---|---|
| streamType | Specifies one or more of the [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |
| saveSettings | Specifies a [SaveSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/savesettings/llms-full.txt) object with additional information and settings for the save operation. |

#### Save(StreamType, SaveSettings, SaveSettings.DialogSettings)

Opens a file `Save As...` dialogbox and saves the complete contents of a document in a user-specified file with special settings. The dialogbox offers the specified file format filters and additional options.

```csharp
public System.Windows.Forms.DialogResult Save(StreamType streamType, SaveSettings saveSettings, SaveSettings.DialogSettings dialogSettings);
```

```vbnet
Public Function Save(streamType As StreamType, saveSettings As SaveSettings, dialogSettings As SaveSettings.DialogSettings) As System.Windows.Forms.DialogResult
```

| Parameter | Description |
|---|---|
| streamType | Specifies one or more of the [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |
| saveSettings | Specifies a [SaveSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/savesettings/llms-full.txt) object with additional information and settings for the save operation. |
| dialogSettings | Specifies one or more of the [SaveSettings.DialogSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/savesettings/dialogsettings-enumeration/llms-full.txt) values. |

#### Save(string, StreamType)

Saves the complete contents of a document in the specified file with the specified format.

```csharp
public void Save(string path, StreamType streamType);
```

```vbnet
Public Sub Save(path As String, streamType As StreamType)
```

| Parameter | Description |
|---|---|
| path | Specifies a file into which the data is saved. If the file does not exist it is created. If the file exists its contents are overwritten. |
| streamType | Specifies one or more of the [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |

#### Save(FileStream, StreamType)

Saves the complete contents of a document in the specified file stream with the specified format.

```csharp
public void Save(FileStream fileStream, StreamType streamType);
```

```vbnet
Public Sub Save(fileStream As FileStream, streamType As StreamType)
```

| Parameter | Description |
|---|---|
| fileStream | Specifies a file into which the data is saved. The data is saved at the stream's current position. |
| streamType | Specifies one or more of the [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |

#### Save(out byte\[\], BinaryStreamType)

Saves the complete contents of a document in the specified byte array with the specified format.

```csharp
public void Save(out byte[] binaryData, BinaryStreamType binaryStreamType);
```

```vbnet
Public Sub Save(ByRef binaryData As Byte(), binaryStreamType As BinaryStreamType)
```

| Parameter | Description |
|---|---|
| binaryData | Specifies a byte array into which the data is saved. No memory needs to be allocated through the caller. |
| binaryStreamType | Specifies one of the [BinaryStreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/binarystreamtype/enumeration/llms-full.txt) values. |

#### Save(out string, StringStreamType)

Saves the complete contents of a document as a string with the specified format.

```csharp
public void Save(out string stringData, StringStreamType stringStreamType);
```

```vbnet
Public Sub Save(ByRef stringData As String, stringStreamType As StringStreamType)
```

| Parameter | Description |
|---|---|
| stringData | Specifies a string into which the data is saved. No memory needs to be allocated through the caller. |
| stringStreamType | Specifies one of the [StringStreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/stringstreamtype/enumeration/llms-full.txt) values. |

#### Save(string, StreamType, SaveSettings)

Saves the complete contents of a document in the specified file using the specified format and special settings.

```csharp
public void Save(string path, StreamType streamType, SaveSettings saveSettings);
```

```vbnet
Public Sub Save(path As String, streamType As StreamType, saveSettings As SaveSettings)
```

| Parameter | Description |
|---|---|
| path | Specifies a file into which the data is saved. If the file does not exist it is created. If the file exists its contents are overwritten. |
| streamType | Specifies one or more of the [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |
| saveSettings | Specifies a [SaveSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/savesettings/llms-full.txt) object with additional information and settings for the save operation. |

#### Save(FileStream, StreamType, SaveSettings)

Saves the complete contents of a document in the specified file stream using the specified format and special settings.

```csharp
public void Save(FileStream fileStream, StreamType streamType, SaveSettings saveSettings);
```

```vbnet
Public Sub Save(fileStream As FileStream, streamType As StreamType, saveSettings As SaveSettings)
```

| Parameter | Description |
|---|---|
| fileStream | Specifies a file into which the data is saved. The data is saved at the stream's current position. |
| streamType | Specifies one or more of the [StreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/streamtype/enumeration/llms-full.txt) values. |
| saveSettings | Specifies a [SaveSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/savesettings/llms-full.txt) object with additional information and settings for the save operation. |

#### Save(out byte\[\], BinaryStreamType, SaveSettings)

Saves the complete contents of a document in the specified byte array using the specified format and special settings.

```csharp
public void Save(out byte[] binaryData, BinaryStreamType binaryStreamType, SaveSettings saveSettings);
```

```vbnet
Public Sub Save(ByRef binaryData As Byte(), binaryStreamType As BinaryStreamType, saveSettings As SaveSettings)
```

| Parameter | Description |
|---|---|
| binaryData | Specifies a byte array into which the data is saved. No memory needs to be allocated through the caller. |
| binaryStreamType | Specifies one of the [BinaryStreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/binarystreamtype/enumeration/llms-full.txt) values. |
| saveSettings | Specifies a [SaveSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/savesettings/llms-full.txt) object with additional information and settings for the save operation. |

#### Save(out string, StringStreamType, SaveSettings)

Saves the complete contents of a document as a string using the specified format and special settings.

```csharp
public void Save(out string stringData, StringStreamType stringStreamType, SaveSettings saveSettings);
```

```vbnet
Public Sub Save(ByRef stringData As String, stringStreamType As StringStreamType, saveSettings As SaveSettings)
```

| Parameter | Description |
|---|---|
| stringData | Specifies a string into which the data is saved. No memory needs to be allocated through the caller. |
| stringStreamType | Specifies one of the [StringStreamType](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/stringstreamtype/enumeration/llms-full.txt) values. |
| saveSettings | Specifies a [SaveSettings](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/savesettings/llms-full.txt) object with additional information and settings for the save operation. |

### Return Value

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

### Examples

The following example exports the current report as a WordprocessingML document.

```csharp
textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Save("quarterly-results.docx", StreamType.WordprocessingML);
```

```vbnet
textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
textControl.Save("quarterly-results.docx", StreamType.WordprocessingML)
```

---

## Nearby

- **Previous:** [TextControl.RulerBar Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/rulerbar-property/llms-full.txt)
- **Next:** [TextControl.ScrollBars Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/scrollbars-property/llms-full.txt)
