Skip to main content
.NET Framework 4.5.2+

SubDocument.GetText(DocumentRange, PlainTextDocumentExporterOptions, TextFragmentOptions) Method

Returns the plain text of the specified document range.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core


string GetText(
    DocumentRange range,
    PlainTextDocumentExporterOptions options,
    TextFragmentOptions getTextOptions


Name Type Description
range DocumentRange

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.


Type Description

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


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:

Event Description
RichEditControl.BeforeExport Does not occur.
RichEditControl.AfterExport Does not occur.


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