Hi ,
i am using Aspose.Words.jdk15-11.2.0.jar and getting issue related to List number format (\u0000.\u0001) does not work for Word in MS word 2010 and 2007.
My test code is
Document doc = null;
try
{
doc = new Document();
}
catch (Exception e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
}
DocumentBuilder builder = new DocumentBuilder(doc);
// Create a list.
com.aspose.words.List list = doc.getLists().add(ListTemplate.NUMBER_ARABIC_DOT);
// Configure list if necessary
// Configure first level.
list.getListLevels().get(0).setNumberStyle(NumberStyle.ARABIC);
list.getListLevels().get(0).setNumberFormat("\u0000)");
// Configure second level
list.getListLevels().get(1).setNumberStyle(NumberStyle.ARABIC);
list.getListLevels().get(1).setNumberFormat("\u0000.\u0001)");
// Configure next levels if neccessary
// …
// First level styel.
// Create a style with a list asociated with it.
Style firstLevelStyel = doc.getStyles().add(StyleType.PARAGRAPH, "FirstLevel");
// Asociate a list with style.
firstLevelStyel.getListFormat().setList(list);
firstLevelStyel.getListFormat().setListLevelNumber(0);
firstLevelStyel.getFont().setSize(20);
// Second level styel.
Style secondLevelStyel = doc.getStyles().add(StyleType.PARAGRAPH, "SecondLevel");
secondLevelStyel.getListFormat().setList(list);
secondLevelStyel.getListFormat().setListLevelNumber(1);
// Apply the list to the current paragraph.
builder.getParagraphFormat().setStyle(firstLevelStyel);
builder.writeln("item 1");
// Incerease level.
builder.getParagraphFormat().setStyle(secondLevelStyel);
builder.writeln("item 1.1");
builder.writeln("item 1.2");
builder.writeln("item 1.3");
// Decrease level
builder.getParagraphFormat().setStyle(firstLevelStyel);
builder.writeln("item 2");
// Disable numbering.
builder.getParagraphFormat().setStyleIdentifier(StyleIdentifier.NORMAL);
try
{
doc.save("C:\ Test.doc");
}
catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
and output of code is :
please, replay as soon as possible
Thanks & regards.