Get the changes from Source Document only

Hi,

Is it possible to get changes only from Source and merge that into result document. I means can get information of the change if it’s coming from source document or target document.

Thanks,
Ashish Markande

1 Like

@ashishm1

Please take a look at this screenshot.png (536.7 KB) and these source/target/output files.zip (26.2 KB).
You will see that ChangeInfo[] is showing you all the content changes (inserted or deleted). Now, once you have this information, API empowers you to accept or reject any change as follows:

changes[0].ComparisonAction = ComparisonAction.Reject;
comparer.ApplyChanges(File.Create(@"D:/output.docx"), new SaveOptions(), new ApplyChangeOptions() { Changes = changes });

We’d recommend you to explore this documentation article - Accept or reject detected changes.