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

Free Support Forum - aspose.com

Working with List and sublists

after writing builder.InsertHtml(lst.SectionDetails != null ? StripHTML.DecodeHTML(lst.SectionDetails) : string.Empty); builder.ListFormat.ListLevel becomes null please help me to solve my problem. Please refer, Working with List and sub lists question in Aspose.Words Forums

Hi,


Thanks for your inquiry. Please follow this thread for further proceedings.

Best regards,

Hi
Thanks for your replay
The above problem is solved after I installed the new version of Aspose.Words
I am facing another problem with builder.InsertHtml(lst.SectionDetails != null ? HttpUtility.HtmlDecode(lst.SectionDetails) : string.Empty);
Here insert html places the data from starting of the left , but I want some tab space(s) before placing the data on word.
After HtmlDecode function calls data is like this

Section1.1

Roughly half of the 4,011 high-risk
Homeland Security watch list are in 10 states: California, Texas, Ohio,
Illinois,
New Jersey.

Committee investigators have indicated that larger
metrw York and
The report
notes that
in comparison large quantities of
toxic gas into a city."


Hi Aspose Team

I also need same requirement like the above.
Please provide solution as soon as possible.

Thanks in advance

Hi,


Thanks for the additional information. Please see the following code:

string html = @“

Section1.1

Roughly
half of the 4,011 high-risk
Homeland Security watch list are in 10
states: California, Texas, Ohio,
Illinois,
New Jersey.
Committee investigators have indicated that larger
metrw York
and
The report
notes that
in
comparison large quantities of toxic gas into a city.

;

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

builder.ListFormat.List = doc.Lists.Add(ListTemplate.NumberDefault);

builder.InsertHtml(html, true);

builder.ListFormat.ListIndent();

builder.ListFormat.ListLevel.NumberStyle = NumberStyle.Arabic;

builder.ListFormat.ListLevel.NumberFormat = "\x0000.\x0001";

builder.Writeln("Sub Section1.1 ");

builder.ListFormat.ListIndent();

builder.ListFormat.ListLevel.NumberStyle = NumberStyle.Arabic;

builder.ListFormat.ListLevel.NumberFormat = "\x0000.\x0001.\x0002";

builder.Writeln("Sub Section 1.1.1");

builder.ListFormat.ListOutdent();

builder.Writeln("Sub Section 1.2 ");

builder.ListFormat.ListOutdent();

builder.Writeln("Main Section2");

builder.ListFormat.ListIndent();

builder.Writeln("Sub Section2.1");

builder.ListFormat.RemoveNumbers();

doc.Save(MyDir + @“out.docx”);


I hope, this helps.

Best regards,