The Aspose “Document.Revisions” API returns the List of Revisions when two Word documents compared using the compare API. we request to add the Revisions property to the content control to detect SDT changes faster.
Could you please look into this…
The sdt.Revisions feature would be a great addition to Aspose, as it would speed up the process of locating content control revisions.
Can you please take a look at this as an enhancement request on your side?
@GZaha Thank you for your suggesting. We will consider providing such functionality. The feature request has been logged as WORDSNET-24257. We will keep you updated and let you know one it is implemented or we have more information for you.
As a workaround you can use the following code to get revisions of nodes inside SDT:
Document doc = new Document(@"C:\Temp\in.docx");
StructuredDocumentTag sdt = (StructuredDocumentTag)doc.GetChild(NodeType.StructuredDocumentTag, 0, true);
// Get child nodes of SDT.
List<Node> sdtChildNodes = sdt.GetChildNodes(NodeType.Any, true).ToList();
// Get revisions applied to the child nodes in the SDT.
List<Revision> sdtRevisions = doc.Revisions.Where(r => sdtChildNodes.Contains(r.ParentNode)).ToList();
// Aceept revisions in SDT.
foreach (Revision r in sdtRevisions)
r.Accept();
doc.Save(@"C:\Temp\out.docx");