PDA

View Full Version : Capturing Number list into simple XML format



nileshshinde
12-22-2011, 11:19 PM
I am working on a small snippet in Word VBA (MS Word 2003) that should be capable of capturing the number list and convert it into simple XML format.

I also have generated most of the XML however i am not able to read the values for the number-style from word's numbered list which i could map to my custom styles (highlighted red in the XML shown in the end of this post).

How do i read the number styles - I / a / i - from the word's number list?


I have attached the screen grab for the number-list in Word which i am trying to read using VBA.


Output XML that is generated so far is as below (current output is without the numberstyle attribute shown below):
-----------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<root>
<section type="list" level="1" listtype="3" numberstyle="roman-big">
<data type="list" level="1">This is number list level 1</data>
<section type="list" level="2" listtype="3" numberstyle="alpha-small">
<data type="list" level="2">This is number list level 2</data>
<section type="list" level="3" listtype="3" numberstyle="roman-small">
<data type="list" level="3">This is number list level 3</data>
<data type="list" level="3">This is number list level 3</data>
</section>
</section>
</section>
</root>
-----------------------------------------------------------------------------------------------------------------------