DocumentBuilderInsertField Method (FieldType, Boolean)
Inserts a Word field into a document and optionally updates the field result.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.10
Syntax
public Field InsertField(
	FieldType fieldType,
	bool updateField
)

Parameters

fieldType
Type: Aspose.Words.FieldsFieldType
The type of the field to append.
updateField
Type: SystemBoolean
Specifies whether to update the field immediately.

Return Value

Type: Field
A Field object that represents the inserted field.
Remarks

This method inserts a field into a document. Aspose.Words can update fields of most types, but not all. For more details see the InsertField(String, String) overload.

Examples
Shows how to insert a field into a document using FieldType
[C#]

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.Write("This field was inserted/updated at ");
builder.InsertField(FieldType.FieldTime, true);

doc.Save(ArtifactsDir + "Document.InsertedField.doc");
See Also