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

Free Support Forum - aspose.com

MailMerge.CleanupOptions does not Remove the Empty Table Rows using .NET

Hi Support Team,

We use mailmerge template with ASPOSE word to replace and generate document. We recently upgraded our package to version After upgrading to the version, we are facing issue while generating table format. Empty columns and rows are getting printed. It works fine when we revert the build to older version. Kindly provide assistance to fix this issue. Refer the snapshot for the issue.

Issue Version Images
empty and column generated.png (136.9 KB)

working version Images working image.png (107.3 KB)



To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please attach the expected output Word file that shows the desired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Please find attached zip file which has the information you requested.

AsposeForum.7z (7.5 MB)



We have logged this problem in our issue tracking system as WORDSNET-22158. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.

Could you please share the old version of Aspose.Words that generates correct output?

It is working fine with the version, We are facing issue after upgrading to Version


Thanks for sharing the detail. We have logged this detail in our issue tracking system. We will inform you via this forum thread once there is any update available on it.

Please let us know when can we expect the fix, since our client are stuck with day today activities.


Currently, your issue is under analysis phase. Once we complete the analysis of your issue, we will then be able to provide you an estimate.


Please use the value of MailMerge.UseWholeParagraphAsRegion as true to get the desired output. The default value of this property is true.

var asposedoc = new Aspose.Words.Document(filestream);
asposedoc.MailMerge.CleanupOptions = MailMergeCleanupOptions.RemoveUnusedRegions | MailMergeCleanupOptions.RemoveUnusedFields;
asposedoc.MailMerge.UseWholeParagraphAsRegion = true;
asposedoc.Save(MailmergeDocument + "21.4"+fromFileNames); 


We changed this value to true as you suggested and the problem resolved. But we are facing other problems through out the document. We cannot use the same TableStart in two places. If we have same attribute name in two arrays of the payload, they got interchanged. Also, if we use same tag twice, the second keyword is replaced empty.

Please provide an solution at the earliest.

We didn’t face these problem until we upgraded the version and was working fine for years. We are facing outages due to incorrect / unformatted document generation.



Please read the limitations of mail merge with regions from here:

Moreover, please make sure that your template document is according to documentation. Please read following article.

If you still face problem, we need your documents for which you are facing this issue. Please ZIP and attach your input, problematic output, and expected output documents along with simplified code example to reproduce the same issue at our end. We will investigate the issue and provide you more information on it.

The issues you have found earlier (filed as WORDSNET-22158) have been fixed in this Aspose.Words for .NET 21.6 update and this Aspose.Words for Java 21.6 update.