Skip to main content
A newer version of this page is available. .

FieldCollection.Create(DocumentPosition, String) Method

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

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

Field Create(
    DocumentPosition start,
    string code
)

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.

This code snippet inserts the DATE field at the caret position.

'Start updating the document
document.BeginUpdate()

'Create a DATE field at the caret position
document.Fields.Create(document.CaretPosition, "DATE")
document.Fields.Update()

'Finalize the modification
document.EndUpdate()

The following code snippets (auto-collected from DevExpress Examples) contain references to the Create(DocumentPosition, String) method.

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.

See Also