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

Free Support Forum - aspose.com

Revision Moving Compare the change

Hi

We are comparing two docs

We can loop through the Revisions collection

For a Move, how can we see what the move is

Thanks

@david.hancock.imagef,

Thanks for your inquiry. You can get the type of revision using Revision.RevisionType property. RevisionType.Moving specifies that content was moved in the document.

Hi

That’s not what I’m asking

For each revision I want to know what Text has changed, not hat it has moved

@david.hancock.imagef,

Thanks for your inquiry. All text of the document is stored in runs of text. You can check the inserted and deleted text of document using Run.IsInsertRevision and Run.IsDeleteRevision properties.

If yous till face problem, please share your input document and expected output here for our reference. We will then provide you more information about your query.

Thanks, that sounds promising

Can you show me how i can get this from the revision object please

@david.hancock.imagef,

Thanks for your inquiry. Please use the following code example to get the changed text in document. Hope this helps you.

Document doc = new Document(MyDir + "in.docx");

foreach (Revision revision in doc.Revisions)
{
    if (revision.ParentNode.NodeType == NodeType.Run)
    {
        Console.WriteLine(revision.ParentNode.ToString(SaveFormat.Text));
    }
}