We're sorry AsposeCloud doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.cloud

Mail Merge XML data into Microsoft Word Template with regions using Aspose.Words REST API

I’m attempting to perform a mail-merge with invoice data against an invoice Word document.

Attached to this post is Invoice.docx, which contains the document I’m working on. I’m using the TableStart and TableEnd fields according to the instructions here ( https://docs.aspose.com/words/net/types-of-mail-merge-operations/#how-to-execute-mail-merge-with-regions ) which also applies to Words-for-Cloud.

Here is the XML data I’m wanting to merge:

<?xml version="1.0" encoding="utf-8"?>


Nelson Street

543 1234

Line 1

Line 2

Line 3

Line 4

However when I run the mail-merge (using /words/Invoice.docx/mailMergeFieldNames?withRegions=True ) none of the fields are merged and the document is essentially unchanged.

Hi David,

The name of repeating table in your template is 'InvoiceItems' but 'Item' repeating tag is used in XML. Name of repeating table in the template and name of repeating tag in the XML should be same. I have changed the name of repeating table in your template to 'Item' and now it is working with this XML.

Please find attached the updated template and feel free to contact us in case you have further comments or questions.

Best Regards,

Huzzah! That worked, thank you!

Can you amend the documentation so that this quirk is clearer? Thanks!

Hi David,

Thanks for your feedback. We will improve the description of mail merge features to address this issue and let you know.

Best Regards,