addList

addList

BASIC / ADVANCED / PREMIUM

Inserts (nested) lists into the Word document.

Description
public void addList(ArrayList data) throws Exception
public void addList(ArrayList data, String styleType) throws Exception
public void addList(ArrayList data, String styleType, OptionsList options) throws Exception

This method allows the insertion of lists (numbered or with bullets) into your Word document.

You may also include nested lists by means of nested arrays of data and fully customize its contents with the use of WordML fragments.

The following style types are always available:

  • Clear: with no bullet or indentation. This is the default value.
  • Unordered: the standard bulleted list of Word.
  • Ordered: the standard ordered list of Word.

You may also use the list styles created via the createListStyle method using the name you gave to your custom list.

Parameters

itemList

The ArrayList of data with the (nested) list of items. The possible values of each array entry are:

  • A string of text.
  • An inline WordFragment: all block elements are removed prior to insertion.
  • An ArrayList.

styleType

0 (clear), 1 (inordinate) (default), 2 (numerical) or the name of the created list

options

Option Type Description
bold Boolean If true the text will be shown in bold characters.
caps Boolean If true displays text in capital letters.
color String Hexadecimal color value: "FF0000", "000000"...
font String Font family: "Arial", "Calibri"...
fontSize Integer Font size in points.
highlightColor String Highlights the run of text. The available colors are: black, blue, cyan, green, magenta, red, yellow, white, darkBlue, darkCyan, darkGreen, darkMagenta, darkRed, darkYellow, darkGray, lightGray, none.
italic Boolean If true displays the text in italics.
numId positive Integer Sets a numId value. Useful to generate a continue numbering.
outlineLvl Integer Heading level (1-9).
pStyle String Word style to be used.
smallCaps Boolean If true displays text in small capital letters.
underline String Underlines text. Possible values are: single, words, double, dotted, dash and wave.
useWordFragmentStyles Boolean Use WordFragment paragraph styles.
Code samples

Example #1

The resulting Word document looks like:

Example #2

The resulting Word document looks like:

Example #3

Example #4

The resulting Word document looks like: