Document.Saved flag?

I’m trying to migrate from VSTO. One of the things that I’m struggling with is Document.Saved flag. In VSTO I can read this property to check whether the document is currently in dirty (unsaved) state. I can even set this flag to true and Word will then ask for saving when user tries to close it.

There doesn’t appear to be anything equivalent to this flag in Aspose Words. Or did I miss something?

@Shujee There is no such property in Aspose.Words. When you instantiate Aspose.Words.Document whole document is loaded into Aspose.Words DOM in memory and Aspose.Words no longer interact with the file itself.
Once you are done with changing the document, you should save it either to file or to stream using the appropriate Document.Save method overload.

Yes, I understand what you’re saying. What I meant was whether there is a way to know whether the in-memory DOM has changed since the last time Document.Save was called.

@Shujee No, unfortunately, there is no such flag. You can try using INodeChangingCallback to track changes made to the document. However, it does not track formatting changes.

Thanks. Must appreciate for your fast response time. I’ll try to work around this requirement.

@Shujee Please feel free to ask in case of any issues. We will be glad to help you.