TX Text Control .NET Server

Load Method

Method|Introduced in 22.0
Namespace
TXTextControl.Web
Package
TXTextControl.Web as TXTextControl.Web.DocumentEditor.dll from nuget.org, the private NuGet feed or Text Control Offline Packages

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);
ParameterDescription
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);
ParameterDescription
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);
ParameterDescription
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);
ParameterDescription
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.");