Font Changes when Inserting HTML with Numbered List into Merge Fields during Mail Merge using C# .NET

I am using Aspose word mail merge for converting html to word with MERGEFIELD. The issues is that, while merging the content, if there is any number list (bullets) in the html, the font get changed automatically to Times new roman. I already sets the font as calibri in Word template.

I am using the following C# code-

MemoryStream filestream = new MemoryStream();
string templatefile = @"Aspose\Template.docx";
Document doc = new Document(templatePath);
doc.MailMerge.CleanupOptions = MailMergeCleanupOptions.RemoveUnusedRegions;
doc.MailMerge.CleanupOptions = MailMergeCleanupOptions.RemoveContainingFields;
doc.MailMerge.CleanupOptions = MailMergeCleanupOptions.RemoveUnusedFields;
doc.MailMerge.CleanupOptions |= MailMergeCleanupOptions.RemoveStaticFields;
doc.MailMerge.CleanupOptions |= MailMergeCleanupOptions.RemoveEmptyParagraphs;
doc.MailMerge.FieldMergingCallback = new HandleMergeFieldInsertHtml("Content");
doc.MailMerge.Execute(new string[] { "Title" }, new object[] { ContentFromDB });
doc.Save(filestream, SaveFormat.Docx);

And the template is like-

{ MERGEFIELD Content \* MERGEFORMAT }

Thank you!

@harigopinath,

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

  • Your simplified input Word document
  • The HTML file/string you are getting this problem with
  • Aspose.Words for .NET 20.1 generated output DOCX file showing the undesired behavior
  • Please also create a standalone simple Console application (source code without compilation errors) that helps us to reproduce your current problem on our end and attach it here for testing. Please do not include Aspose.Words DLL files in it to reduce the file size.

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