Field.ResultRange Property
Returns the range that contains the field result.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v24.1.Core.dll
NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation
Declaration
Property Value
Type | Description |
---|---|
DocumentRange | The document range the field result occupies. |
Example
The code sample below checks all field results and inserts “Empty Value!” if the field result is empty:
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
using System.Drawing;
using (var wordProcessor = new RichEditDocumentServer()) {
Document document = wordProcessor.Document;
foreach (Field field in document.Fields) {
string strResult = document.GetText(field.ResultRange);
if (strResult == "") {
document.InsertText(field.ResultRange.Start, "Empty Value!");
}
}
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the ResultRange property.
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.