Hello
Hi
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for your request. You can use ListLevel.NumberFormat to specify custom number’s format:
For example, see the following code:
Document doc = new Document();
// Create a list based on one of the Microsoft Word list templates.
List list = doc.getLists().add(ListTemplate.NUMBER_DEFAULT);
// Completely customize one list level.
ListLevel level1 = list.getListLevels().get(0);
level1.setNumberStyle(NumberStyle.ARABIC);
level1.setNumberFormat("\u0000.");
// Completely customize yet another list level.
ListLevel level2 = list.getListLevels().get(1);
level2.setNumberStyle(NumberStyle.ARABIC);
level2.setNumberFormat("FA\u0001.");
// Now add some text that uses the list that we created.
// It does not matter when to customize the list - before or after adding the paragraphs.
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getListFormat().setList(list);
builder.writeln("The quick brown fox...");
builder.writeln("The quick brown fox...");
builder.getListFormat().listIndent();
builder.writeln("jumped over the lazy dog.");
builder.writeln("jumped over the lazy dog.");
builder.getListFormat().listOutdent();
builder.writeln("The quick brown fox...");
builder.getListFormat().removeNumbers();
doc.save("C:\\Temp\\out.doc");
Hope this helps. Please let me know if you need more information, I will be glad to help you.
Best regards,
Thank you for the quick response, and sorry for asking something that is documented.