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

Free Support Forum - aspose.com

One of two documents not preforming Mail Merge

I am looking for an answer why only one of the two attached documents with the same mail merge tags works.


The attached is just an example but I have also included the PDF output from the two mail merges. Code running each merge is the same and not the problem

I am also looking for what I need to setup within Word in the Failed_SimpleList.docx for it to merge correctly as I have many of these which do not work but the formatting has already been finished on these (much this formatting is lost when copy/paste for some reason).

I am sure it’s just something I am forgetting that I did to the first document when I made it several weeks ago…


Thanks

Hello

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. The problem occurs because the region with the same name exists inside Header of your document. Please just clear Header/Footer before MailMerge:

doc.FirstSection.HeadersFooters.Clear();

Best regards,

Thank you very much,

I didn’t realize that merge regions in the header even within “different header for first page” header when “different header for first page” is disabled actually affected the behavior of the ExecuteWithRegions

This has saved me plenty of headaches now.

Hello

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please let me know in case of any issue I will be glad to help you.

Best regards,