Dear Aspose Team,
I have a large Word document with a lot of revisions (Document.Revisions.Count > 22 000). Now I want to accept all Revisions that are older than e.g. 7 days.
That is why I cannot use the acceptAllRevisions() function.
Iterating over all revisions in one go also does not work, I either get an Exception from the RevisionsCollection or the Word document is broken afterwards (if I copy the revisions into a separate list).
The only way I got it working was to only take one item from the RevisionsCollection at a time and accepting that:
Revision r = doc.getRevisions().get(0);
while (r != null)
{
r.accept();
try
{
r = doc.getRevisions().get(0);
}
catch (Exception e)
{
r = null;
}
}
That way I could check the dates in there.
BUT, this is extremely slow, it takes multiple minutes to process the 20k revisions.
Is there a better way to do that?