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

FieldCollection.Create(DocumentRange) Method

Creates a field from the specified range and adds it to the field collection.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

Field Create(
    DocumentRange range
)
Function Create(
    range As DocumentRange
) As Field

Parameters

Name Type Description
range DocumentRange

A DocumentRange object specifying a range to be transformed to a field.

Returns

Type Description
Field

A Field object specifying the newly created field.

Remarks

The Create method transforms the specified range to the field. The text content of the range becomes the code of the newly created field.

Document document = server.Document;
document.BeginUpdate();
document.AppendText("SYMBOL 0x54 \\f Wingdings \\s 24");
document.EndUpdate();
document.Fields.Create(document.Paragraphs[0].Range);
document.Fields.Update();
See Also