StyleType enumeration

StyleType enumeration

Represents type of the style.


Name Description
PARAGRAPH The style is a paragraph style.
CHARACTER The style is a character style.
TABLE The style is a table style.
LIST The style is a list style.


Shows how to create a list style and use it in a document.

doc = aw.Document()

# A list allows us to organize and decorate sets of paragraphs with prefix symbols and indents.
# We can create nested lists by increasing the indent level.
# We can begin and end a list by using a document builder's "list_format" property.
# Each paragraph that we add between a list's start and the end will become an item in the list.
# We can contain an entire List object within a style.
list_style = doc.styles.add(aw.StyleType.LIST, "MyListStyle")

list1 = list_style.list


# Change the appearance of all list levels in our list.
for level in list1.list_levels: = "Verdana"
    level.font.color =
    level.font.bold = True

builder = aw.DocumentBuilder(doc)

builder.writeln("Using list style first time:")

# Create another list from a list within a style.
list2 = doc.lists.add(list_style)


# Add some list items that our list will format.
builder.list_format.list = list2
builder.writeln("Item 1")
builder.writeln("Item 2")

builder.writeln("Using list style second time:")

# Create and apply another list based on the list style.
list3 = doc.lists.add(list_style)
builder.list_format.list = list3
builder.writeln("Item 1")
builder.writeln("Item 2")
builder.list_format.remove_numbers() + "Lists.create_and_use_list_style.docx")

See Also