In Word API, a template with no repeating items in the data-merge field in one file is defined as the simple type.
This section describes the Word API data-merge feature of the simple type.
You can use CSV and JSON format files for the simple type merging data.
The simple type requires single CSV file that specifies the data-merge field name for the field name and the data for the merging data.
The simple type requires a single JSON file consisting of a data-merge field name for the key and an array of objects specified the merging data to that value.
An example is shown below.
Following two formats can be output with an option of the data-merge result.
This is the default setting of Word API. Single file is output regardless of the number of records of data as same as Microsoft Word mail merge.
The option "Single" for each interface corresponds to it.
When this option is specified, the last data of the merging data is merged into the data-merge fields in the header and footer areas.
Single file is output for each record of data.
(Example): If you execute a three-record data-merge, three files will be output.
The option "PerData" for each interface corresponds to it.
When outputting a file for each record, the
output file name and the
additional position of the output file name text will be enabled.
[Install directory]/samples/templates/Simple_type_template.zip contains the simple type data-merge template and the sample file of the data.