Our solution provides a powerful platform independent API. Use our Mail merge document API to develop high-level software for C++ platform. This is a powerful software solution for merging templates in Word and PDF formats and data from custom data sources and further exporting the result to DOCX, PDF, HTML and other popular formats using C++.
With our C++ solution you can create documents, personalized for each recipient, using the Mail merge feature in C++. To do this, just use the Mail merge template and data from the customer data source.
A merge template is a document with merge fields – special fields where you want personalized data from your data source to be inserted. As a merge template, use a PDF or Word document in DOC or DOCX format with special merge fields.
The data source is the data store from which data is pulled during the Mail merge operation to personalize your documents.
You can also build reports using the Mail merge operation. Just create a Mail merge template with merge fields that will be used for report generation and select the data source. You can even generate reports from excel data if you collect it there. So you see how easy it is to generate reports in C++.
The following example shows how to perform a Mail merge operation in C++. To verify this, load a document template with merge fields and fill in these fields through our interface. After running the code, download the result of the Mail merge in a convenient format such as DOCX or PDF, generated in C++.
For example, you can perform Mail merge operation with Word document files such as DOC or DOCX and save the output to PDF:
dotnet add package Aspose.Words.Cpp
Copy
using namespace Aspose::Words;
auto fields = MakeArray<String>(
{
});
auto values = MakeArray<SharedPtr<Object>>(
{
});
auto doc = MakeObject<Document>(u"Input.docx");
doc->get_MailMerge()->Execute(fields, values);
doc->Save(u"Output.docx");
There are three options to install Aspose.Words for C++ to your developer environment. Please choose one that resembles your needs and follow the step-by-step instructions:
You can use this C++ library to develop software on Microsoft Windows, Linux and macOS operating systems:
If you develop software for Linux or macOS, please check information on additional library dependencies (fontconfig and mesa-glu open-source packages) in Product Documentation.