We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.words for java 19.10 has incorrect revision count

using the following code:

import com.aspose.words.Document;
import com.aspose.words.License;

public class IncorrectRevisionCount {

  public static void main(String[] args) throws Exception {
    License license = new License();
    license.setLicense("Aspose.Total.lic");

    String path = "/path/to/incorrect_revision_count.docx";

    Document document = new Document(path);
    System.out.println(document.getRevisions().getCount() + " Revisions");
  }
}

It prints out that the document has 1027 revisions. When I look at the document in Microsoft Word, I see 357 revisions:

image.png (11.0 KB)

incorrect_revision_count.docx.zip (224.0 KB)

The expected behavior is that aspose.words would have a revision count of 357, which would match what microsoft word reports the document having

thanks

@PeteLee

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-19463. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@PeteLee

Thanks for your patience. It is to inform you that the issue which you are facing is actually not a bug in Aspose.Words. So, we have closed this issue (WORDSNET-19463) as ‘Not a Bug’.

The count of revisions shown in Revision Pane in MS Word is count of revision groups. To get this value you should use Document.Revisions.Groups property. It equal to 352 for source document.

Additionally MS Word shows comments as revisions. There are 5 comments in document. So, 352 + 5 = 357. To get comment count in the document you can use Document.GetChildNodes(NodeType.Comment, true).Count property.

Document document = new Document(MyDir + "incorrect_revision_count.docx");
System.out.println(document.getRevisions().getGroups().getCount() + " Revisions");
System.out.println(document.getChildNodes(NodeType.COMMENT, true).getCount() + " comments count");

thank you very much!