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: 20.1
public bool IsDirty { get; set; }

Property Value

Type: Boolean
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);


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