Skip to main content

Field.ResultRange Property

Returns the range that contains the field result.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v26.1.Core.dll

NuGet Package: DevExpress.RichEdit.Core

Declaration

DocumentRange ResultRange { get; }

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!");
        }
    }
} 
See Also