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

Free Support Forum - aspose.com

Doc revisions aspose word

Hi all,

I want to know how paragraphe or how section exactly revised on a word document.
is it possible ?

the code HasRevisions work on doc but not on paragraphe.

Best regards,
Jugurtha

@Jugurtha_MAHDAD Please consider the following code.

private bool HasRevisions(Node para)
{
    Document doc = (Document)para.Document;
    foreach (Revision revision in doc.Revisions)
    {
        Node node = revision.ParentNode;
        while (node != null)
        {
            if (para == node)
                return true;
            node = node.ParentNode;
        }
    }
    return false;
}

Usage:

Assert.AreEqual(true, HasRevisions(doc.Sections[1]));
Assert.AreEqual(false, HasRevisions(doc.FirstSection.Body.Paragraphs[1]));