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();
//license2.SetLicense("Aspose.Total.lic");

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);

doc.Save(dataDir);

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

@jitendra1

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)

Thanks
Jitendra Chauhan

@jitendra1

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.