WordProcessingML and Numbered Lists Restarting

I get a lot of questions about Word, XML, and how it all works. I get questions about other products and technologies as well. Many of the questions come directly to my inbox from customers. In a way, I feel bad, because I just don't have time to handle the requests. Besides, we have many solid support folks that handle requests rather well for the most part. Nonetheless, I sometimes carve out some time to answer them, and this blog entry is an answer to a customer's question. I hope Peter (who is apparently closely affiliated with a woman named Sherri, based on his email- way to go, Peter!) appreciates the response.

Here's the main question of the mail:

I am experimenting with word ML and am trying to figure out how to restart list numbering after a section break.

He was trying to use the w:lvlrestart element. Turns out, he was doing what so few people do: he actually read the reference documentation! I applaude him for that. I also thank him for leading down the rabbit hole into the under-documented world of Word list numbering.

First, the short answer for Peter: w:lvlrestart is what you use in the styles section of the WordProcessingML description. IOW: you define a numbering style that starts re-numbering at a given level. That way, as you type and tab, Word looks at the style and figures out for you when it should start renumbering. Cool enough.

In your text runs inside your WordProcessingML, whether or not you have tweaked the numbering styles, you can always start a new section with new numbering by just spelling it out that way in the XML. I have explained in previous entries how the lists are articulated in WordML. For example, here's are two lists (partial XML here):

          <w:listPr>
            <w:ilvl w:val="0" />
            <w:ilfo w:val="1" />
            <wx:t wx:val="2." wx:wTabBefore="360" wx:wTabAfter="195" />
            <wx:font wx:val="Times New Roman" />
          </w:listPr>
        </w:pPr>
        <w:r>
          <w:t>Two</w:t>
        </w:r>
      </w:p>
      <w:p>
        <w:pPr>
          <w:listPr>
            <w:ilvl w:val="0" />
            <w:ilfo w:val="2" />
            <wx:t wx:val="1." wx:wTabBefore="360" wx:wTabAfter="195" />
            <wx:font wx:val="Times New Roman" />
          </w:listPr>
        </w:pPr>
        <w:r>
          <w:t>One</w:t>
        </w:r>
      </w:p>
      <w:p>
        <w:pPr>
          <w:listPr>
            <w:ilvl w:val="0" />
            <w:ilfo w:val="2" />
            <wx:t wx:val="2." wx:wTabBefore="360" wx:wTabAfter="195" />
            <wx:font wx:val="Times New Roman" />
          </w:listPr>
        </w:pPr>
        <w:r>
          <w:t>Two</w:t>
        </w:r>
      </w:p>
      <w:p />

So, what the heck is the w:lvlrestart really all about? What does it do? I'll explain that tomorrow, and I wish post captures of the dialog box that is supposed to, but does not, make it clear.

Rock Thought for the day: We are having dance at my church on the January 15th, and it is going to be all 80's pop, punk, and techno (for those of you interested in coming, the dance is here: 32751 NE 45TH ST, CARNATION , WA 98014 which you can easily look up on www.mappoint.com; the dance starts at 7pm, and you can consider this your invitation! [I'm the person responsible for the dance, so it's OK] I would love to meet some of my audience there, so come and chat and we can all laugh at how we "dance"). In any case, my friends and I were discussing the plans for the music and it sure brought back memories of countless bands and songs (I graduated in 1984). Yes, we will be playing Rock Lobster by the B-52s. Yes, we will be doing some Thompson Twins and Flock of Seagulls. No, we will not be doing Peter Cetera or Journey (although I still like Journey). Yes, we will be doing Eurythmics and throwing in The Clash! Thomas Dolby? Gary Numan? Oh yeah. What a laugh my friend and I had about these.

Rock on