Free Support Forum - aspose.com

About Execute & ExecuteWithRegions

Hi there,

I have a question. What is the difference between doc.MailMerge.Execute() method and doc.MailMerge.ExecuteWithRegions() ? Why Execute() methods trigger the MergeField event and ExecuteWithRegions() does not.

How can I run ExecuteWithRegions() with an event like MergeField triggered ?

Thanks.

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

Thanks for your inquiry. If you want to dynamically grow portions inside the document, use mail merge with regions. Please see the following links for more information.

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/simple-mail-merge-explained.html

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/mail-merge-with-regions-explained.html

MergeField event occurs during mail merge when a simple mail merge field is encountered in the document. So you can use this event both in simple mail merge and in mail merge with regions.

Best regards.