The attached document opens fine in Word, and I am able to freely accept/reject the changes. However, when I attempt to do the following on it using Aspose 21.10:
Document document = new Document(new FileInputStream(new File(inputPath)));
final List<Revision> formatRevisions = new ArrayList<Revision>();
for (Revision revision : document.getRevisions()) {
if (revision.getRevisionType() == RevisionType.FORMAT_CHANGE) {
formatRevisions.add(revision);
}
}
for (Revision revision : formatRevisions) {
revision.accept();
}
I get the following exception:
Caused by: java.lang.IllegalStateException: Invalid document model. Operation can not be completed.
at com.aspose.words.zzVRM.zzZdX(Unknown Source)
at com.aspose.words.zzVRM.zzWPL(Unknown Source)
at com.aspose.words.zzVRM.zzFe(Unknown Source)
at com.aspose.words.zzVRM.zzVTQ(Unknown Source)
at com.aspose.words.zzYGb.zzWPL(Unknown Source)
at com.aspose.words.zzYGb.zzWgK(Unknown Source)
at com.aspose.words.zzYGb.zznj(Unknown Source)
at com.aspose.words.zzYGb.zzWPL(Unknown Source)
at com.aspose.words.Revision.zzWPL(Unknown Source)
at com.aspose.words.Revision.accept(Unknown Source)
// snip
revisions.docx (11.5 KB)