Save Method
- Namespace
TXTextControl.Web
- Package
TXTextControl.asWeb TXTextControl.from nuget.org, the private NuGet feed or Text Control Offline PackagesWeb. DocumentEditor. dll
Description
Saves the selected text of a document with the specified format.
Syntax
Save(string, StreamType)
Saves the selected text 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 | Saves the selected text of a document in the specified file with the specified format. |
| streamType | Specifies one of the StringStreamType values. |
Save(FileStream, StreamType)
Saves the selected text 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 selection is saved. The data is saved at the stream's current position. |
| streamType | Specifies one of the StringStreamType values. |
Save(out byte[], BinaryStreamType)
Saves the selected text of a document in the specified byte array with the specified format.
public void Save(out byte[] data, BinaryStreamType streamType);Public Sub Save(ByRef data As Byte(), streamType As BinaryStreamType)| Parameter | Description |
|---|---|
| data | Specifies a byte array into which the selection is saved. No memory needs to be allocated through the caller. |
| streamType | Specifies one of the StringStreamType values. |
Save(out string, StringStreamType)
Saves the selected text of a document as a string with the specified format.
public void Save(out string stringData, StringStreamType streamType);Public Sub Save(ByRef stringData As String, streamType As StringStreamType)| Parameter | Description |
|---|---|
| stringData | Specifies a string into which the selection is saved. No memory needs to be allocated through the caller. |
| streamType | Specifies one of the StringStreamType values. |
Examples
The following example uses Selection.Save in a document-processing workflow.
selection.Save(@"App_Data\document.docx", TXTextControl.Web.StreamType.PlainAnsiText);
Console.WriteLine("Save completed for the Selection workflow.");selection.Save("App_Data\document.docx", TXTextControl.Web.StreamType.PlainAnsiText)
Console.WriteLine("Save completed for the Selection workflow.")