FieldUpdate Method (Boolean)

Performs a field update. Throws if the field is being updated already.

Namespace:  Aspose.Words.Fields
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.6

Syntax

public void Update(
	bool ignoreMergeFormat
)

Parameters

ignoreMergeFormat
Type: SystemBoolean
If true then direct field result formatting is abandoned, regardless of the MERGEFORMAT switch, otherwise normal update is performed.

Examples

Shows a way to update a field ignoring the MERGEFORMAT switch.
LoadOptions loadOptions = new LoadOptions { PreserveIncludePictureField = true };
Document doc = new Document(MyDir + "Field sample - INCLUDEPICTURE.docx", loadOptions);

FieldIncludePicture includePicture = (FieldIncludePicture)doc.Range.Fields.First(f => f.Type == FieldType.FieldIncludePicture);
includePicture.SourceFullName = ImageDir + "Transparent background logo.png";
includePicture.Update(true);

doc.UpdateFields();
doc.Save(ArtifactsDir + "Field.UpdateFieldIgnoringMergeFormat.docx");

See Also