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

Free Support Forum - aspose.com

Access Revisions Inside Revisions in Word Documents

Hi,



I’m running into some issue using Aspose Words. I’ll attach a sample document here for reference.



The main problem I’m facing here is that if a text is inserted by one user and then deleted by another, I can’t reference the inner revision from your DOM.



Is there a way to get the Delete revision in my sample document (InseredDeleted.doc)? I tried getting it from the Aspose.Words.Document.Revisions but it doesn’t seem to be there. All I see are Insert revisions.



Thanks.

Hi,


Thanks for your inquiry. Please try running the following code with Aspose.Words for .NET 16.2.0:

Document doc = new Document(MyDir + @“InsertedDeleted.doc”);

foreach (Revision rev in doc.Revisions)

{

Console.WriteLine(rev.RevisionType + " by " + rev.Author + " : " + rev.ParentNode.ToString(SaveFormat.Text));

}


The Paragraph that has the deletion revision actually has two Run nodes. The second Run node comprises of deletion revision text. You can use the following properties to determine if a Paragraph and/or the child node (Run) have what revisions:

Paragraph/Run.IsDeleteRevision property
Paragraph/Run.IsFormatRevision property
Paragraph/Run.IsInsertRevision property

Hope, this helps.

Best regards,