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

Free Support Forum - aspose.com

Save document with Lisitng

Hi ,
I am using Aspose.words.Java .I used the below code to create paragraph list. If i save it as .DOCX , listing character ( '1' ) is shown correct . But when i saved it as .DOC, am not getting the list level character properly, it shows the like "%1.". please do help me .

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Paragraph para = builder.insertParagraph();
para.getListFormat().getListLevel().setNumberFormat("%1.");//No i18n
doc.save("D:\\out.doc", SaveFormat.DOC);

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 ,

I have attached my document below . please do help me along with the code .

Hi Anbu,

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



//ListLevel level1 = list.getListLevels().get(0);






doc.save(MyDir + "Out.doc");

doc.save(MyDir + "Out.docx");