facebooktwittermenuarrow-up

GemBox Support Forum

Column Break possible?

Is there a way to initiate a column break while adding paragraphs into a Textbox? Could not find any commands for force a column break.

Hi,

Unfortunately, I’m not sure what exactly you’re referring to.

Can you show me what context you have, what you’re doing, and what you would like to get as a result?

Regards,
Mario

Mario, this is basically, what I’m doing. I only want 14 items in the first column. Thanks

var slide =  presentation.Slides.AddNew(SlideLayoutType.TitleOnly);

var contentShape = slide.Content.AddShape(ShapeGeometryType.Rectangle, Length.From(.42, LengthUnit.Inch), 92, 900, 400);
contentShape.Format.Fill.SetNone();

var format = contentShape.Text.Format;
format.ColumnNumber = 2;
format.ColumnSpacing = 1;

foreach (var item in items)
{
    if (numberOfItemsOnSlide > 14)
    {
        // force column break here
    }

    var paragraph = textBox.AddParagraph();
    paragraph.Format.Alignment = HorizontalAlignment.Left;
    textBox.Format.VerticalAlignment = VerticalAlignment.Top;
    textBox.Format.InternalMarginTop = Length.From(.1, LengthUnit.Inch);

    var run = paragraph.AddRun(item.DisplayName);
    run.Format.Bold = true;
    run.Format.Size = 11;
    run.Format.Fill.SetSolid(Color.FromName(ColorName.Black));

    numberOfItemsOnSlide++;
    paragraph.AddLineBreak();
}

Hi,

I see now.

Unfortunately, PowerPoint doesn’t have the ability to insert a column break in a multi-column TextBox element.

However, there is a feature request for this on the following page and you can Vote for it:
https://powerpoint.uservoice.com/forums/288949-powerpoint-for-windows-desktop-application/suggestions/17273855-add-a-column-break-command-for-multiple-column-tex

It is one of the top 5 features so hopefully, Microsoft will introduce support for column breaks in the future.

As a workaround for now, can you switch to using a Table element with one row and two cells?

Regards,
Mario