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

Free Support Forum - aspose.com

MailMerge Remove Empty Fields

Previously when doing a mail merge I used:

doc.MailMerge.CleanupOptions = MailmergeCleanupOptions.RemoveUnusedFields;

it removed any fields that were not used.

Now that is obsolete I use the only options are:

doc.MailMerge.RemoveEmptyParagraphs
doc.MailMerge.RemoveEmptyRegions

Setting both to true, any unused fields still remain on the document.

How can I remove unused fields?

Hi Quang,


Thanks for your inquiry. In case you’re using the latest version of Aspose.Words (11.8.0), please use MailMergeCleanupOptions.RemoveUnusedFields to automatically remove unmerged merge fields during mail merge. Both MailMerge.RemoveEmptyParagraphs and MailMerge.RemoveEmptyRegions have been deprecated in latest versions.

Best Regards,