Save Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesServer. dll
Description
Saves the complete contents of a document with the specified format.
Syntax
Save(string, StreamType)
Saves the complete contents of a document in the specified file with the specified format.
public void Save(string path, StreamType streamType);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 of the StreamType values. |
Save(FileStream, StreamType)
Saves the complete contents of a document in the specified file stream with the specified format.
public void Save(FileStream fileStream, StreamType streamType);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 of the StreamType values. |
Save(out byte[], BinaryStreamType)
Saves the complete contents of a document in the specified byte array with the specified format.
public void Save(out byte[] binaryData, BinaryStreamType binaryStreamType);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 values. |
Save(out string, StringStreamType)
Saves the complete contents of a document as a string with the specified format.
public void Save(out string stringData, StringStreamType stringStreamType);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 values. |
Save(string, StreamType, SaveSettings)
Saves the complete contents of a document in the specified file using the specified format and special settings.
public void Save(string path, StreamType streamType, SaveSettings saveSettings);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 of the StreamType values. |
| saveSettings | Specifies a SaveSettings 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.
public void Save(FileStream fileStream, StreamType streamType, SaveSettings saveSettings);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 of the StreamType values. |
| saveSettings | Specifies a SaveSettings 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.
public void Save(out byte[] binaryData, BinaryStreamType binaryStreamType, SaveSettings saveSettings);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 values. |
| saveSettings | Specifies a SaveSettings 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.
public void Save(out string stringData, StringStreamType stringStreamType, SaveSettings saveSettings);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 values. |
| saveSettings | Specifies a SaveSettings object with additional information and settings for the save operation. |
Save(byte[], string, StreamType, ref SaveSettings)
public void Save(byte[] internalFormat, string path, StreamType streamType, ref SaveSettings saveSettings);Public Sub Save(internalFormat As Byte(), path As String, streamType As StreamType, ByRef saveSettings As SaveSettings)Examples
The following example exports the current report as a WordprocessingML document.
textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Save("quarterly-results.docx", StreamType.WordprocessingML);textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
textControl.Save("quarterly-results.docx", StreamType.WordprocessingML)