Back to Devexpress

SubDocument.GetText(DocumentRange, PlainTextDocumentExporterOptions, TextFragmentOptions) Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-subdocument-dot-gettext-x28-documentrange-plaintextdocumentexporteroptions-textfragmentoptions-x29.md

latest3.9 KB
Original Source

SubDocument.GetText(DocumentRange, PlainTextDocumentExporterOptions, TextFragmentOptions) Method

Returns the plain text of the specified document range.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
string GetText(
    DocumentRange range,
    PlainTextDocumentExporterOptions options,
    TextFragmentOptions getTextOptions
)
vb
Function GetText(
    range As DocumentRange,
    options As PlainTextDocumentExporterOptions,
    getTextOptions As TextFragmentOptions
) As String

Parameters

NameTypeDescription
rangeDocumentRange

A DocumentRange object, specifying the range in the document for which the plain text representation is obtained.

| | options | PlainTextDocumentExporterOptions |

A PlainTextDocumentExporterOptions instance, containing options for plain text export.

| | getTextOptions | TextFragmentOptions |

A TextFragmentOptions object.

|

Returns

TypeDescription
String

A String value, containing the text of the specified range.

|

Remarks

Use this method to get a plain text representation of any part of the document. This method overload triggers export-related events as described in the following table:

EventDescription
RichEditControl.BeforeExportDoes not occur.
RichEditControl.AfterExportDoes not occur.

Note

If you operate with a selection range, the GetText method should be combined with a DocumentRange.BeginUpdateDocument - DocumentRange.EndUpdateDocument method pair. Otherwise, an incorrect document model might be selected, resulting in an exception “Error: specified document position or range belongs to other document or subdocument” being thrown.

For an example of use, refer to another SubDocument.GetText method overloads.

See Also

SubDocument Interface

SubDocument Members

DevExpress.XtraRichEdit.API.Native Namespace