How to create nested list in the below format

Hi,
Currently we are using Aspose.Words 10.2.0.0 Version.
I want to create a list in the doc like this :

  1. Test
  2. Test1
    Test2
  3. Test3

I have tried with some code using like this

builder.ListFormat.RemoveNumbers()
builder.InsertHtml("<div>This needs to be more text on ListLevel 0 without it being numbered.</div>");

Note: My content is always HTML so i want to use builder.InsertHTML instead of

builder.Writeln("")

Please find the sample attached file

Thaniks in advance

Hi Seenu,

Thanks for your query. Please use the following code snippet for your requirement. Hope this helps you. Please use the latest version of Aspose.Words for .NET and let us know if you have any more queries.

Document doc = new Document();
Aspose.Words.Lists.List list = doc.Lists.Add(ListTemplate.NumberDefault);
DocumentBuilder builder = new DocumentBuilder(doc);
builder.ListFormat.List = list;
builder.Writeln("Test");
builder.Writeln("Test1");
builder.ListFormat.RemoveNumbers();
//builder.Writeln("Test2");
builder.InsertHtml("<div>This needs to be more text on ListLevel 0 without it being numbered.</div>");
builder.ListFormat.List = list;
builder.Writeln("Test3");
builder.Document.Save(MyDir + "AsposeOut.doc");

Thanks for reply.

How ever the solution that u have sent is bit different than what i need.
Please refer the attached document.

Note: Please observe the indentation of “Un Numbered Text”. It should start with Number list Indentation.

Hi Seenu,

Please use the ParagraphFormat.LeftIndent for your requirement. Please use the following code snippet and let us know if you have any more queries.

Document doc = new Document();
Aspose.Words.Lists.List list = doc.Lists.Add(ListTemplate.NumberDefault);
DocumentBuilder builder = new DocumentBuilder(doc);
builder.ListFormat.List = list;
builder.Writeln("Test");
builder.Writeln("Test1");
builder.ListFormat.RemoveNumbers();
//builder.Writeln("Test2");
builder.InsertHtml("<div>This needs to be more text on ListLevel 0 without it being numbered.</div>");
((Paragraph)builder.CurrentParagraph.PreviousSibling).ParagraphFormat.LeftIndent = 19.0;
builder.ListFormat.List = list;
builder.Writeln("Test3");
builder.ListFormat.RemoveNumbers();
builder.Document.Save(MyDir + "AsposeOut.doc");