GemBox.Document Element
GemBox.Document Inline
GemBox.Document Field
Namespace: GemBox.Document
Assembly: GemBox.Document (in GemBox.Document.dll) Version: 21.3.30.1113
public sealed class Field : Inline, IContentElement
Fields are used in a mail merge and, usually, in scenarios where document information can be resolved only when document is rendered (for example, page numbers).
GemBox.Document supports nested fields - another field can be contained in an InstructionInlines or a ResultInlines properties of a field.
Fields are defined by the Field.FieldType and, optionally, Field.InstructionInlines that usually contains field arguments and switches, but can also contain other fields, and Field.ResultInlines that contains the latest field's value.
GemBox.Document doesn't have a resolver or a calculation engine that refreshes field's result based on its field type and instruction text. Field's result is simply read from and written to a document file. To refresh a field result you must use Microsoft Word. Field result refreshing can be expected to be implemented in a future versions of GemBox.Document.
If Field.InstructionInlines contains only Runs, you can use Field.GetInstructionText() to retrieve instruction as a String.
For a field creation example, see fields sample.