Hi Anbu,
Thanks for your inquiry. The ListLevel.NumberFormat returns or sets the number format for the list level. Among normal text characters, the string can contain placeholder characters \x0000 to \x0008 representing the numbers from the corresponding list levels.
For example, the string “\x0000.\x0001)” will generate a list label that looks something like “1.5)”. The number “1” is the current number from the 1st list level, the number “5” is the current number from the 2nd list level.
You may use Document.UpdateListLabels to update list labels for all list items in the document. This method updates list label properties such as LabelValue and LabelString for each ListLabel object in the document.
Could you please share your expected output document here for our reference? We will then provide you more information on this along with code.
Hi ,
Hi Anbu,
Thanks
for sharing the document. Please use the following code example to get the required output and let us know if you have any more queries. Hope this helps you.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Create a list.
com.aspose.words.List list = doc.getLists().add(ListTemplate.NUMBER_DEFAULT);
builder.getListFormat().setList(list);
builder.getListFormat().getListLevel().setNumberFormat("\u0000.");
//ListLevel level1 = list.getListLevels().get(0);
//level1.setNumberFormat("\u0000.");
builder.writeln("One");
builder.writeln("Two");
builder.writeln("Three");
builder.getListFormat().removeNumbers();
doc.save(MyDir + "Out.doc");
doc.save(MyDir + "Out.docx");