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: 19.12
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.UpdateFieldIgnoringMergeFormat.docx", loadOptions);

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

        includePicture.SourceFullName = MyDir + "Images/dotnet-logo.png";
        includePicture.Update(true);
    }
}

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