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

Free Support Forum - aspose.com

Changing Font in Merge Field

<span style="font-size:8.0pt;font-family:"Verdana","sans-serif";mso-bidi-font-family:

Arial">Following is a part used in our aspose word template.
---------------------------------------------------------------------------------------------------------------------------

Performance Detail

Credit Risk to Investor

«Credit Risk»

«Status»

---------------------------------------------------------------------------------------------------------------------------

If you see there is a merge field Status, which we replace with some HTML from the database through our C# code. Following is the piece of code that does this task.


_builder.MoveToMergeField("Status");
string statusText = _summaryData["Status"].ToString();
statusText = Regex.Replace(statusText, "", string.Empty);
statusText = Regex.Replace(statusText, "", string.Empty);
statusText = Regex.Replace(statusText, "", string.Empty);
statusText = Regex.Replace(statusText, "
", string.Empty);
_builder.InsertHtml(statusText);

Now the Merge Field have font of Verdana 8, but the final output shows Calibri 11. Please note we don't have much control over the _summaryData["Status"] which is coming from DB directly in the form of a long HTML string, but the final font we want in the output should be verdana 8. I have tried few things but not working. All the other text have Verdana 8 font on that page.

Any help on this is much appreciated..!!!

Hi there,

Thanks for your inquiry. It would be great if you please share following detail for investigation purposes.


  • Please attach your input Word document.
  • Please

    create a standalone/runnable simple application (for example a Console
    Application Project
    ) that demonstrates the code (Aspose.Words code) you used to generate
    your output document

  • Please attach the output Word file that shows the undesired behavior.
  • Please
    attach your target Word document showing the desired behavior. You can
    use Microsoft Word to create your target Word document. I will
    investigate as to how you are expecting your final document be generated
    like.

Unfortunately,
it is difficult to say what the problem is without the Document(s) and
simplified application. We need your Document(s) and simple project to
reproduce the problem. As soon as you get these pieces of information to
us we’ll start our investigation into your issue.