Free Support Forum - aspose.com

Multi Level lists in word docs

I am sure there is a sane way of doing this but I am trying to navigate a nested list structure where multiple para structures are included that are not marked as list items.

So: -
list 1 item 1
list 1 item 2
list 2 item 1
normal para
normal para
normal para
list 2 item 2
list 2 item 3
list 1 item 3

The normal para is not an itemized para but for part of list 2 item1.
It seems that looking ahead at normal para for other list 2 items is the only sure way to decide that normal para belongs to and continues list 2.


Have I got this right or is there a easier/safer way that I have missed.

Thanks

Jan

Hi Jan,


Thanks for your inquiry. I would suggest you please read the following article on Document Tree Navigation:
http://www.aspose.com/docs/display/wordsnet/Document+Tree+Navigation

You can determine/visualize the position of your non-list Paragraphs in Aspose.Words’ DOM. Also, the Paragraph.ListFormat.IsListItem property will return false for these Paragraphs. I hope, this helps in achieving what you are looking for.

Please let me know if I can be of any further assistance.

Best regards,

Thank you for replying.

Whilst knowing that a para is a list item (numbered etc) is good and also knowing that its level can be established the real problem is know whether a para that is not marked as a list item belongs to the list.

A simple example is : -
1.0 A single list para that is marked as a list item
Another para not marked as a list item

There seems to be no concept of a list starting or stopping so how can I deduce whether “Another para not marked as a list item” is part of the list or is a para following the list.

I am trying to build a CALs structure which is all about a contained list.

Cheers
Jan
Hi Jan,

Thanks for your inquiry. Could you please attach your sample Word document here for testing? I will investigate the structure of your document and provide you more information.

Best regards,
Hi,

I have attached the docx and the xml that I need to construct so hopefully this will illustrate the problem.
It seems to me that the only way that a para that has no item number can be tested for a consecutive list item para is by using the indented value?

Cheers
Jan

Hi Jan,


Thanks for the additional information. Yes, you are right; you can determine if a normal Paragraph is appearing under some ListItem from it’s Left or First Line Indentation value. If we can help you with anything else, please feel free to ask.

Best regards,