This gist contains code snippets related to fill Mail Merge Template using Aspose.Words Cloud SDK for .NET. For more information, please visit
Last active
May 1, 2021 17:25
-
-
Save aspose-cloud/41d2a2127601c8c754ba2fd406f20ab9 to your computer and use it in GitHub Desktop.
This gist contains code snippets related to Mail Merge in MS Word template using Aspose.Words Cloud SDK for .NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String MyClientID = "c235e685-1aab-4cda-a95b-54afd63eb87f"; // Get MyClientID from https://dashboard.aspose.cloud/ | |
String MyClientSecret = "b8da4ee37494f2ef8da3c727f3a0acb9"; // Get MyClientSecret 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 inputDocument = "SampleMailMergeTemplate.docx"; | |
string inputDataFile = "SampleMailMergeTemplateData.txt"; | |
// name of resultant file | |
string resultantFile = "TestPostDocumentExecuteMailMerge.docx"; | |
// read the content of data file | |
string data = File.ReadAllText("/Downloads/" + inputDataFile, System.Text.Encoding.UTF8); | |
// Create ExecuteMailMergeRequest object by providing input file, data file and resultant output details | |
Requests.ExecuteMailMergeRequest request = new Requests.ExecuteMailMergeRequest(inputDocument, data, null, null, null, null, null, null, null, null, resultantFile); | |
// perform the mail merge operation | |
DocumentResponse result = wordsApi.ExecuteMailMerge(request); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This gist contains code snippets related to performing Mail Merge operation on MS word template using Aspose.Words Cloud SDK for .NET |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment