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

Free Support Forum - aspose.com

List formatting

I have a list style and if I simply select text in Word 2003 and apply the style, I get the expected results. However, if I parse the document (using the DocumentBuilder and IDocumentVisitor) and just set a paragraph’s style to that same list style (builder.ParagraphFormat.Style = “list1”, the style is applied but the list formatting in the style essentially is lost.

Am I doing something wrong or will the upcoming detailed list formatting mentioned in the latest release notes remedy these types of issues?


List and Table styles are not fully supported because they are not documented to us.

Thanks for your quick response. Actually, what I thought was a problem with the list style may be an issue with lists in general. The standard code snippet for lists generates the same behavior:

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

builder.Writeln("Item 1");
builder.Writeln("Item 2");
builder.Writeln("Item 3");

doc.Save(@"c:\list.doc", SaveFormat.FormatDocument);

When I edit list.doc in Word, hitting Enter in the middle of the list gives me new list numbers as expected but then hitting a Tab, which should give me the next list level, instead moves the cursor all the way to the left without any list formatting at all. I know I have all the proper AutoFormat settings turned on since manually inputting multilevel list items works.

I’ve been learning WAY too much about Word lists lately and I realize that it is a special kind of hell. Is there anything in Aspose.Word that I need to do differently?

You do everything properly and current list behaviour is the only possible. However, we have logged your report as an enhancement request so we will surely improve the lists in the future.

Try latest Aspose.Words. There’ve been significant improvements to list formatting support since you reported the issue. It might be doing what you want now.