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

Free Support Forum - aspose.com

Set Font Color of Paragraph in Word Template during Building Report using LINQ Reporting Engine C# .NET | Insert HTML Block in DOCX

We were wondering if it is possible to set the font color of a paragraph in a Word Template.

This would be a big improvement instead of having duplicate paragraphs (with different colors) and then having an if-switch.

Thank you

@braintribe,

I think, you can make use of -HTML switch:

DocumentBuilder builder = new DocumentBuilder();
builder.Writeln("<<[\"not HTML\"]>>");
builder.Writeln("<<[\"<b>Bold</b> and <i>italic</i> <span style='color:green'> green text</span>\"] -html>>");

ReportingEngine engine = new ReportingEngine();
engine.BuildReport(builder.Document, new object());

builder.Document.Save("C:\\Temp\\20.9.docx");

Please refer to following article for more details:

Hi,

Thank you very much! That helps a lot!

Regards,

Roman


This Topic is created by shahzadlatif using Email to Topic tool.