SplitTextByColumns

ITextFrame.SplitTextByColumns method

Splits the text content of the ITextFrame into an array of strings, where each element corresponds to a separate text column within the frame.

public string[] SplitTextByColumns()

Return Value

An array of strings, where each string represents the text content of a specific column in the ITextFrame.

Remarks

If the text frame does not contain multiple columns, the returned array will have a single element containing the full text. Empty columns will be represented as empty strings in the array.

Examples

The following example demonstrates how to use SplitTextByColumns:

using (Presentation pres = new Presentation("example.pptx"))
{
    // Get the first shape on the slide and cast it to ITextFrame
    ITextFrame textFrame = pres.Slides[0].Shapes[0] as ITextFrame;
    // Split the text frame content into columns
    string[] columnsText = textFrame.SplitTextByColumns();
    // Print each column's text to the console
    foreach (string column in columnsText)
        Console.WriteLine(column);
}

See Also