Skip to main content
.NET Framework 4.5.2+

FieldCollection.Create(DocumentPosition, String) Method

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

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core


Field Create(
    DocumentPosition start,
    string code


Name Type Description
start DocumentPosition

A DocumentPosition at which the field is inserted.

code String

A string specifying the field’s code.


Type Description

A Field object specifying the newly created field.


The code snippet below uses the SYMBOL field to add a check mark (✔) to the document:

using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())
    // Access a document.
    Document document = wordProcessor.Document;

    // Start to edit the document.

    // Create the "SYMBOL" field.
    document.Fields.Create(document.Range.Start, "SYMBOL 252 \\f Wingdings \\s 28");

    // Finalize to edit the document.

    // Update all fields in the main document body.

    // Save the document to the file.
    document.SaveDocument("Result.docx", DocumentFormat.OpenXml);

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


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