FieldIsDirty Property
Gets or sets whether the current result of the field is no longer correct (stale) due to other modifications made to the document.

Namespace: Aspose.Words.Fields
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.12
Syntax
public bool IsDirty { get; set; }

Property Value

Type: Boolean
Examples
Shows how to use special property for updating field result
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Field fieldToc = builder.InsertTableOfContents("\\o \"1-3\" \\h \\z \\u");
fieldToc.IsDirty = true;

MemoryStream stream = new MemoryStream();
doc.Save(stream, SaveFormat.Docx);

Assert.IsTrue(doc.Range.Fields[0].IsDirty);

LoadOptions loadOptions = new LoadOptions { UpdateDirtyFields = false };
doc = new Document(stream, loadOptions);
See Also