.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

Field Interface

Represents a field in the document.

Namespace: DevExpress.XtraRichEdit.API.Native

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


public interface Field

The following members accept/return Field objects:

Library Related API Members
WinForms Controls SnapEntity.Field
Office File API Field.Parent
FieldCollection.Create(DocumentPosition, String)


A field is a set of codes that instructs a RichEditControl to insert text or graphics into a document automatically. The text or graphics inserted into a document when a control processes a field’s codes is the field result for that field. The action of processing a field’s codes to obtain a field result is called a field update.

A field in the document consists of two ranges - the Field.CodeRange and the Field.ResultRange. The total range that the field occupies is obtained via the Field.Range property.

In the document, either field codes or the field result can be displayed. Use the Field.ShowCodes method to display codes. The Field.Update method calculates and displays the result. You can also use the following commands to display field codes or results: the ToggleFieldCodesCommand command, the ToggleViewMergedDataCommand command, the ShowAllFieldCodesCommand command, ShowAllFieldResultsCommand command.

The fields in the document can be highlighted. Use the RichEditControlOptionsBase.Fields property to specify the color and highlighting mode.

All fields in the document are contained in the FieldCollection, accessible via the SubDocument.Fields property.

Document document = server.Document;
document.Fields.Create(document.Range.Start, "DATE");
See Also