Aspose::Words::TextColumnCollection::SetCount method

TextColumnCollection::SetCount method

Arranges text into the specified number of text columns.

void Aspose::Words::TextColumnCollection::SetCount(int32_t newCount)
ParameterTypeDescription
newCountint32_tThe number of columns the text is to be arranged into.

Remarks

When EvenlySpaced 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.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);

SharedPtr<TextColumnCollection> columns = builder->get_PageSetup()->get_TextColumns();
columns->set_Spacing(100);
columns->SetCount(2);

builder->Writeln(u"Column 1.");
builder->InsertBreak(BreakType::ColumnBreak);
builder->Writeln(u"Column 2.");

doc->Save(ArtifactsDir + u"PageSetup.ColumnsSameWidth.docx");

See Also