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

Free Support Forum - aspose.com

The Underline css not work properly in Aspose Word

Hi Team.

I am using aspose.word 19.5
and code is-

string dataDir = @"D:\Backup\Reports\" + "FinalReport" + DateTime.Now.Ticks + ".docx";
//Aspose.Words.License license2 = new Aspose.Words.License();

Aspose.Words.Document doc = new Aspose.Words.Document();
DocumentBuilder builder = new DocumentBuilder(doc);

string s = "<div>Profile Notes: <span style =\"text-decoration-line:underline;\"> According to the <span style=\"font-weight:normal;font-style:italic;\" > Gov.</span> State <span style=\"font-weight:bold;\"> Securities </span> Board; <span style=\"font-weight:normal;font-style:normal;color:rgb(255, 0, 0);\" > November </span> 05, 2019: This is only for test </span > now.&nbsp;</div> ";

builder.InsertHtml(s, true);


The Underline css not work properly.
Please suggest me better approach to create word document.


We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-18709. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi @tahir.manzoor,

Thanks for reply.
can you please suggest me another approach to achieve this ( The Underline css not work properly in Aspose Word)

Jitendra Chauhan


All text of the document is stored in runs of text. You can use Run.Font.Underline property to set the underline font formatting of text.