I need to detect if a document has unaccepted tracked changes.
I would expect the hasRevisions() method to return true if the document has unaccepted tracked changes and false if not. But in practice this method is returning true if the doucment has ever had any tracked changes, even if those changes have been accepted. Is this a bug or is this by design? The documentation says “Returns true if the document has any tracked changes”.
If this is the intended behavior, is there a way to detect only unaccepted tracked changes?
Thank you for attachment. Indeed, HasRevisions is true. I have logged this as defect Auckland-78 and hopefully it will be fixed until the next minor release is out.
The thing about your document is that although MS Word says there are no revisions in your document, there is in fact one revision. It can be seen if you save the document as WordML or RTF in Microsoft Word.
For some reason MS Word does not report it as a revision, but Aspose.Words does (because by all means it looks like a revision). I’m going to look at this more.
I just downloaded the latest Aspose words for Java and it doesn’t look like this is fixed. I’m getting the same incorrect behavior from the hasRevisions() method as described above.
I see a Document.getVersionsCount() method but not a getVersionCount(). What does getVersionsCount() do? I don’t see it mentioned in any documentation.
Gets the number of document versions that was stored in the DOC document.
Versions in Microsoft Word are accessed via the File/Versions menu. Microsoft Word supports versions only for DOC files (no versions in RTF and WordprocessingML).
This property allows to detect if there were document versions stored in this document before it was opened in Aspose.Words. Aspose.Words provides no other support for document versions. If you save this document using Aspose.Words, the document will be saved without versions.
Sorry, I think getVersionsCount was for another customer, I got it all crossed. I was sure by implementing getVersionsCount I’m resolving the hasRevisions issue for you. In this case next update of Aspose.Words for Java will contain the fix.