David Thibault
David Thibault

Reputation: 8736

How to create bullet lists in WordML?

I have the following WordML snippet which works well for numbered lists :

<w:wordDocument xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml">
  <w:lists>
    <w:listDef w:listDefId="1">
      <w:lvl w:ilvl="0">
        <w:start w:val="1" />
        <w:lvlText w:val="%1." />
        <w:pPr>
          <w:ind w:left="720" w:hanging="360" />
        </w:pPr>
      </w:lvl>
      <w:lvl w:ilvl="1">
        <w:start w:val="1" />
        <w:lvlText w:val="%2." />
        <w:pPr>
          <w:ind w:left="1080" w:hanging="360" />
        </w:pPr>
      </w:lvl>
    </w:listDef>
    <w:list w:ilfo="2">
      <w:ilst w:val="1" />
    </w:list>
  </w:lists>
  <w:body>
    <wx:sect>
      <w:p>
        <w:pPr>
          <w:listPr>
            <w:ilvl w:val="0" />
            <w:ilfo w:val="2" />
          </w:listPr>
        </w:pPr>
        <w:r>
          <w:t xml:space="preserve">Item 1</w:t>
        </w:r>
      </w:p>
      <w:p>
        <w:pPr>
          <w:listPr>
            <w:ilvl w:val="1" />
            <w:ilfo w:val="2" />
          </w:listPr>
        </w:pPr>
        <w:r>
          <w:t xml:space="preserve">Item 1.1</w:t>
        </w:r>
      </w:p>
      <w:p>
        <w:pPr>
          <w:listPr>
            <w:ilvl w:val="1" />
            <w:ilfo w:val="2" />
          </w:listPr>
        </w:pPr>
        <w:r>
          <w:t xml:space="preserve">Item 1.2</w:t>
        </w:r>
      </w:p>
      <w:p>
        <w:pPr>
          <w:listPr>
            <w:ilvl w:val="0" />
            <w:ilfo w:val="2" />
          </w:listPr>
        </w:pPr>
        <w:r>
          <w:t xml:space="preserve">Item 2</w:t>
        </w:r>
      </w:p>
      <w:p>
        <w:pPr>
          <w:listPr>
            <w:ilvl w:val="1" />
            <w:ilfo w:val="2" />
          </w:listPr>
        </w:pPr>
        <w:r>
          <w:t xml:space="preserve">Item 2.2</w:t>
        </w:r>
      </w:p>
    </wx:sect>
  </w:body>
</w:wordDocument>

However, I can't figure out how to create a bulleted list. I have seen lvlPicBulletId but I don't understand how to use it. Anybody knows how to do it?

Thanks.

Upvotes: 1

Views: 3860

Answers (2)

J.Hogan
J.Hogan

Reputation: 460

A bulleted list in WordML is defined by the level NFC value of 23.

<w:listDef>
  <w:lvl>
    <w:nfc w:val="23"/>
  </w:lvl>
<w:listDef>

You can then define the symbol used for the bullet by setting the w:lvlText value.

<w:listDef>
  <w:lvl>
    <w:lvlText w:val="o"/>
  </w:lvl>
</w:listDef>

The following URL will take you to the NFC elements reference page on MSDN but it does not provide very much detail.

http://msdn.microsoft.com/en-us/library/office/ee364387(v=office.11).aspx

Hope that helps! :-)

Upvotes: 1

David Thibault
David Thibault

Reputation: 8736

Turns out that bullets are simply characters in specific fonts. For example, here is the lvl element for a filled circle :

<w:lvl w:ilvl="0">
  <w:lvlText w:val="&#183;" />
  <w:rPr>
    <w:rFonts w:ascii="Symbol" w:h-ansi="Symbol" w:hint="default" />
  </w:rPr>
  <w:pPr>
    <w:ind w:left="720" w:hanging="360" />
  </w:pPr>
</w:lvl>

Upvotes: 4

Related Questions