Merge review changes

Hello

I have two identical files that have changes in review mode, how can I merge them into one file?

@Forbz Do you mean Combine feature (Review Tab > Compare > Combine) of Word? Unfortunately, Aspose.Words does not support this feature yet. The feature request is logged as WORDSNET-13484.

@alexey.noskov Yes I mean this Combine feature. And there is no way to manually somehow go through the document and insert changes from the second file, for example?

@Forbz You can copy nodes with revisions from one document to another. For example see the following simple code that copies deleted Run nodes to the end of the destination document:

Document src = new Document(@"C:\Temp\src.docx");
Document dst = new Document(@"C:\Temp\dst.docx");

foreach (Run r in src.GetChildNodes(NodeType.Run, true))
{
    if (r.IsDeleteRevision)
        dst.LastSection.Body.LastParagraph.AppendChild(dst.ImportNode(r, true));
}

dst.Save(@"C:\Temp\out.docx");

But to achieve Combine feature, a complex document content analysis is required.

Hello
In order to insert comments, will I need to import and insert the following nodes: CommentStart->Run->CommentEnd->Comment?

@Forbz You should insert Comment node with it’s children (content of the comment). If it is required to mark some are as commented area, then it is required to insert CommentRangeStart and CommentRangeEnd nodes. Please see our documentation to learn how to work with comments:
https://docs.aspose.com/words/net/working-with-comments/

Comments in .odt files don’t have CommentRangeStart and CommentRangeEnd. So how I need to add comment from another file, if i can’t read the range of commetned area? If I just add comment there is no selected area.

Comment


Result

P.S. I will say more, if you just open the file and immediately save it, the highlighted area will be removed from the comments

Is it a workable option to convert .odt files to .docx, merge the files and convert back to .odt to avoid this bug?

@Forbz Could you please attach the problematic ODT document here for our reference? We will check it and provide you more information.

OdtFiles.zip (35.7 KB)

@Forbz
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-27085

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.