SubDocument.GetText(DocumentRange) Method
Returns the plain text of the specified document range.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v24.2.Core.dll
NuGet Package: DevExpress.RichEdit.Core
#Declaration
string GetText(
DocumentRange range
)
#Parameters
Name | Type | Description |
---|---|---|
range | Document |
A Document |
#Returns
Type | Description |
---|---|
String | A String value, containing the text of the specified range. |
#Remarks
Use the GetText method to get a plain text of any part of the document. This method overload triggers export-related events as described in the following table:
Event | Description |
---|---|
Rich |
Allows you to specify options for plain text export (defined by the Plain |
Rich |
Does not occur. |
Note
If you operate with a selection range, the Get
#Example
DevExpress.XtraRichEdit.API.Native.Document document = server.Document;
document.LoadDocument("Documents\\Grimm.docx", DocumentFormat.OpenXml);
string plainText = document.GetText(document.Paragraphs[2].Range);
System.Windows.Forms.MessageBox.Show(plainText);
#Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the GetText(DocumentRange) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.