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

FieldCollection.Create(DocumentPosition, String) Method

Adds a field specified by its code to the field collection.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

Field Create(
    DocumentPosition start,
    string code
)
Function Create(
    start As DocumentPosition,
    code As String
) As Field

Parameters

Name Type Description
start DocumentPosition

A DocumentPosition at which the field is inserted.

code String

A string specifying the field's code.

Returns

Type Description
Field

A Field object specifying the newly created field.

Remarks

Use the Create method to insert a new field in a document.

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