Skip to content

Instantly share code, notes, and snippets.

@aspose-cloud
Last active April 28, 2021 00:57
Show Gist options
  • Save aspose-cloud/566ff2ffc3697922074b76f790c2d40a to your computer and use it in GitHub Desktop.
Save aspose-cloud/566ff2ffc3697922074b76f790c2d40a to your computer and use it in GitHub Desktop.
This gist contains code snippets related to Compare MS word files using Aspose.Words Cloud SDK for .NET
This gist contains code snippets related to Compare MS word files using Aspose.Words Cloud SDK for .NET
String MyClientID = "c235e685-1aab-4cda-a95b-54afd63eb87f"; // Get Client Id from https://dashboard.aspose.cloud/
String MyClientSecret = "b8da4ee37494f2ef8da3c727f3a0acb9"; // Get Client Secret from https://dashboard.aspose.cloud/
// crate an instance of Configuration class
// and provide your personalized Client ID and Client Secret details
var config = new Configuration { ClientId = MyClientID, ClientSecret = MyClientSecret };
// initialize WordsAPI object using Configuration instance
var wordsApi = new WordsApi(config);
// first input document
string firstDocument = "file-sample.docx";
// second document to be compared with
string secondFile = "file-sample-updated.docx";
// name of resultant file
string resultantFile = "Out_ComparedTestDocs.docx";
// Create an instance of CompareData class
CompareData compareData = new CompareData();
// name to be used as author identifying the differences
compareData.Author = "Nayyer";
// specify the document to compare with
compareData.ComparingWithDocument = secondFile;
compareData.DateTime = DateTime.Now;
// create Request instance by providing source, document to compare and resultant file name
CompareDocumentRequest request = new CompareDocumentRequest(firstDocument, compareData, null, null, null, null, resultantFile);
// initiate the document comparison
DocumentResponse result = wordsApi.CompareDocument(request);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment