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

Free Support Forum - aspose.com

MailMerge in change font when datatable empty


When we do a mail merge with an empty datatable and we clean the document aspose.words change the font selected for the megefield removed.
Could you please fix it?

Sample Codes:
Document words = new Document(@“D:\test\test_mailMerge -ArrayFailed.docx”);
DataSet ds = new DataSet();
DataTable dt = new DataTable(“table”);
DataColumn dc = new DataColumn(“test1”, typeof(String));
dc = new DataColumn(“test2”, typeof(String));
/* DataRow newRow = dt.NewRow();
newRow[0] = "test ";
newRow[1] = “test 2”;
newRow = dt.NewRow();
newRow[0] = “test 3”;
newRow[1] = “test 4”;
string[] fields = { “TEST3”, “TEST4”, “TEST6” };

string[] fvalues = { “HELLO”, “HELLO”, “Test2” };

words.MailMerge.Execute(fields, fvalues);

words.Range.Replace("%%TEST5%%", “HELLO”, false, false);

words.Range.Replace("%%TEST6%%", “WORD”, false, false);

words.Range.Replace("%%TEST7%%", “Test2”, false, false);

/ Clean unused*/
words.MailMerge.CleanupOptions = Aspose.Words.MailMerging.MailMergeCleanupOptions.RemoveUnusedRegions |
Aspose.Words.MailMerging.MailMergeCleanupOptions.RemoveUnusedFields | Aspose.Words.MailMerging.MailMergeCleanupOptions.RemoveStaticFields |
Aspose.Words.MailMerging.MailMergeCleanupOptions.RemoveEmptyParagraphs | Aspose.Words.MailMerging.MailMergeCleanupOptions.RemoveContainingFields;
// Create a dummy data source containing no data.
DataSet data = new DataSet();



Hi Stephan,

Thanks for your inquiry. I have generated and attached a document (15.12.0.docx) using your code and Aspose.Words for .NET 15.12.0 here for your reference. Could you please create comparison screenshot which shows the problematic areas in Aspose.Words generated DOCX and attach it here for our reference. We will investigate the issue further on our end and provide you more information.

Best regards,

Please see attachment

Hi Stephan,

Thanks for the additional information. While using the latest version of Aspose.Words i.e. 15.12.0, we managed to reproduce this issue on our end. We have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-12917. Your thread has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-12917) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.