set_count method

set_count(new_count)

Arranges text into the specified number of text columns.

def set_count(self, new_count: int):
    ...
ParameterTypeDescription
new_countintThe number of columns the text is to be arranged into.

Remarks

When TextColumnCollection.evenly_spaced is False and you increase the number of columns, new TextColumn objects are created with zero width and spacing. You need to set width and spacing for the new columns.

Examples

Shows how to create multiple evenly spaced columns in a section.

doc = aw.Document()
builder = aw.DocumentBuilder(doc)
columns = builder.page_setup.text_columns
columns.spacing = 100
columns.set_count(2)
builder.writeln('Column 1.')
builder.insert_break(aw.BreakType.COLUMN_BREAK)
builder.writeln('Column 2.')
doc.save(file_name=ARTIFACTS_DIR + 'PageSetup.ColumnsSameWidth.docx')

See Also