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

Free Support Forum - aspose.com

Accept all changes on a paragraph

How do you accept all changes on a paragraph. Currently Accept All Changes works at document level.

I tried to see if I can iterate through the doc.revisions collection and accept all insertions/deletions on a paragraph, but it does not work. You cannot find revisions related to a paragraph, as if during trackchanges, you did RemoveAllChildren(), it create new paragraph.
Hi Cary,

Thanks for your inquiry. We have logged your requirement in our issue tracking system. The ID of this issue is WORDSNET-13584. Our product team will further look into the details of this problem and we will keep you updated on the status of this issue. We apologize for your inconvenience.

Best regards,

Hi Cary,


Thanks for being patient. Please try using the following code:

for (int idx =
doc.Revisions.Count - 1; idx >= 0; idx–)

{

Revision revision = doc.Revisions[idx];

if (revision.ParentNode.NodeType == NodeType.Paragraph)

{

revision.Accept();

}

}


Revision.ParentNode returns the immediate parent node (owner) of this revision. If the owner of this revision is Paragraph, you can accept this revision only.

Hope, this helps.

Best regards,