We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Mail merge issue with Essential Studio v9.3.0.61

Hello.

I'm attempting to evaluate v9.3.0.61 of Essential studio. We are already using the .Net 3.5 assemblies in v7.3.0.20 but are looking to upgrade to the latest version.

We're using Word document templates, and then populating the templates with data using the MailMerge.Execute() method.

Our code loops through each merge field to be populated in the template, and merges the data, one field at a time. So the Mail.Merge.Execute() is called for each merge field, rather than building arrays all the merge fields and values to be populated and then calling the MailMerge.Execute() method once, passing in the arrays.

The v7.3.0.20 assemblies would allow us to do this, and we would have no problems with populating the templates with data.

However, when using the v9.3.0.61 assemblies we've found that only the first merge field in the loop will be populated correctly in the document. It seems as though when the first merge takes place, the other merge fields in the template are removed or disregarded as no other merged data appears in the template.

So, my question is, has something changed with the underlying code in the MailMerge.Execute() method between v7.3.0.20 and v9.3.0.61? Are we now required to build the arrays of fields and values to merge and call the MailMerge.Execute() once, or would we still be able to call the MailMerge.Execute() multiple times on the same document without affecting the as yet un-merged fields in the document?

Any assistance would be appreciated - I would like to avoid having to re-write a lot of our code!

Many thanks.



1 Reply

PR Poornima R Syncfusion Team September 12, 2011 08:10 AM UTC

Hi William,

Thank you for your interest in Syncfusion products.

The document.MailMerge.Execute method updates all the occurrence of the specified merge field in document and clears all other unmatched merge fields from the documents. For merging the fields one at a time you can make use of the overload method - Execute(string[ ] fieldNames, string[ ] fieldValues).
DocIO has a Boolean property document.MailMerge.ClearFields (by default it is set as true) which removes all the unmatched mail merge fields from the document while mail merging. We have to set document.MailMerge.ClearFields property as false, to preserve the unmatched mail merge fields in the document before calling document.MailMerge.Execute method.

We have prepared a sample to illustrate your requirement of mail merging without removing the unmatched mail merge fields in the document. Please do find the sample from the following location.

Sample Link:
Sample902407720.zip

For more information regarding mail merge functionality of DocIO, please refer the following User guideline link:

http://help.syncfusion.com/ug_93/Reporting/DocIO/ASP.NET/Documents/46mailmerge.htm

There is no change in the functionality of Execute() method from 7.3 to current release. Could you please share us your sample application and assemblies used (7.3 version) to reproduce the mentioned issue on our side.

Please let us know if you have any other questions.

Regards,
Poornima



Loader.
Live Chat Icon For mobile
Up arrow icon