How to determine the number formats from ordered list

Hi,

I have a requirement to read numbers and its formats from word document, I am able to read numbers from ListLabel.labelString. But not able to understand number style or number format from ListLevel it has number format as “\0.” for ‘1.’. and number style as arabic. and even for ‘1.1’. the style is Arabic and number format is “\u0001.”
Is there anything that can give the difference between this two items in the list. Using Aspose

Thanks

@Nizzam2024 The number \x0000, \x0001, \x0002 etc. specified the level from where the number is taken. ListLevel.NumberStyle specified number style for the specified level. For example let’s create a simple 3 levels list:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

List lst = doc.Lists.Add(ListTemplate.NumberDefault);
lst.ListLevels[0].NumberFormat = "\x0000";
lst.ListLevels[0].NumberStyle = NumberStyle.Arabic; // The first level numbers will be arabic digits
lst.ListLevels[1].NumberFormat = "\x0000.\x0001"; // List label of the second level will be the first level number and the second level number separate by dot
lst.ListLevels[1].NumberStyle = NumberStyle.LowercaseLetter; // The second level numbers will be lowercase letter
lst.ListLevels[2].NumberFormat = "\x0000.\x0001.\x0002"; // first, second and thord level numbers separated by dot
lst.ListLevels[2].NumberStyle = NumberStyle.UppercaseRoman; // The third level numbers will be upper case roman number.

// Add some list items.
builder.ListFormat.List = lst;
builder.Writeln("First item, first level");
builder.ListFormat.ListIndent();
builder.Writeln("First item, second level");
builder.Writeln("Second item, second level");
builder.ListFormat.ListIndent();
builder.Writeln("First item, third level");
builder.Writeln("Second item, third level");
builder.Writeln("Third item, third level");
builder.ListFormat.RemoveNumbers();

doc.Save(@"C:\Temp\out.docx");

out.docx (7.8 KB)

In the code we specified format and different number style for each level and we see this difference in the output document.