Setting author of changes
Leave feedback
On this page
GroupDocs.Comparison allows you to set the changes author name in the resulting document. To do this, follow these steps:
- Instantiate the
Comparer
object. Specify a source file path or an input stream. - Call the
add
method. Specify a target file path or an input stream. - Instantiate the
CompareOptions
object. Set theWordTrackChanges
andShowRevisions
properties totrue
. - Set the author of changes via the
RevisionAuthorName
property. - Call the
compare()
method. Specify theCompareOptions
object from the previous step.
The following code snippet shows how to set the changes author:
const comparer = new groupdocs.comparison.Comparer(sourcePath);
comparer.add(targetPath);
const compareOptions = new groupdocs.comparison.CompareOptions();
compareOptions.setShowRevisions(true);
compareOptions.setWordTrackChanges(true);
compareOptions.setRevisionAuthorName("New author");
comparer.compare(resultPath, compareOptions);
The result is as follows:
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.