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.3
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 INCLUDEPICTURE.docx", loadOptions);

foreach (Field field in doc.Range.Fields)
{
    if (field.Type.Equals(FieldType.FieldIncludePicture))
    {
        FieldIncludePicture includePicture = (FieldIncludePicture)field;

        includePicture.SourceFullName = ImageDir + "Transparent background logo.png";
        includePicture.Update(true);
    }
}

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