Load Method
- Namespace
TXTextControl.Web
- Package
TXTextControl.asWeb TXTextControl.from nuget.org, the private NuGet feed or Text Control Offline PackagesWeb. DocumentEditor. dll
Description
Exchanges the currently selected text with text in a certain format.
Syntax
Load(string, StreamType)
Exchanges the currently selected text with text in the specified format. The new text is read from the specified file.
public void Load(string path, StreamType streamType);Public Sub Load(path As String, streamType As StreamType)| Parameter | Description |
|---|---|
| path | Specifies a file from which the data is loaded. |
| streamType | Specifies one of the StreamType values. |
Load(FileStream, StreamType)
Exchanges the currently selected text with text in the specified format. The new text is read from the specified file stream.
public void Load(FileStream fileStream, StreamType streamType);Public Sub Load(fileStream As FileStream, streamType As StreamType)| 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 values. |
Load(byte[], BinaryStreamType)
Exchanges the currently selected text with text in the specified format. The new text is read from the specified byte array.
public void Load(byte[] binaryData, BinaryStreamType binaryStreamType);Public Sub Load(binaryData As Byte(), binaryStreamType As BinaryStreamType)| Parameter | Description |
|---|---|
| binaryData | Specifies a byte array from which the data is loaded. |
| binaryStreamType | Specifies one of the BinaryStreamType values. |
Load(string, StringStreamType)
Exchanges the currently selected text with text in the specified format. The new text is read from the specified string.
public void Load(string stringData, StringStreamType stringStreamType);Public Sub Load(stringData As String, stringStreamType As StringStreamType)| Parameter | Description |
|---|---|
| stringData | Specifies a string from which the data is loaded. |
| stringStreamType | Specifies one of the StringStreamType values. |
Examples
The following example uses Selection.Load in a document-processing workflow.
selection.Load(@"App_Data\document.docx", TXTextControl.Web.StreamType.PlainAnsiText);
Console.WriteLine("Load completed for the Selection workflow.");selection.Load("App_Data\document.docx", TXTextControl.Web.StreamType.PlainAnsiText)
Console.WriteLine("Load completed for the Selection workflow.")