Using MS Word VBA how can we convert the following nested list in a Word document to an html nested list. I know in Word-VBA ActiveDocument.Lists
is a collection of all lists and ListParagraphs
is a collection of list items in a list. But I'm unable to loop through these collections to get a handle of the following nested list in Word document:
Word document nested list:
HTML nested List:
<ol>
<li>Test1</li>
<li>Test2</li>
<ul>
<li>Test2a</li>
<li>Test2b</li>
</ul>
<li>Test3</li>
<li>Test4</li>
</ol>
UPDATE:
Using code from user @TimWilliams
below I get the following result that actually treating sub-list as a separate list 2 (as shown below). But I need to know that the list 2 is indeed a nested list of list 1. How can I achieve this?
List: 1 Level: 1 Label: 1. Text: Test1
List: 1 Level: 1 Label: 2. Text: Test2
List: 1 Level: 1 Label: 3. Text: Test3
List: 1 Level: 1 Label: 4. Text: Test4
List: 2 Level: 2 Label: a) Text: Test2a
List: 2 Level: 2 Label: b) Text: Test2b
ListLevelNumber
- stackoverflow.com/questions/8424573/… – Tim Williams