Columns Interface

A collection of Column objects that represent the columns in a table.

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
<GuidAttribute("914934C4-5A91-11CF-8700-00AA0060263B")> _
Public Interface Columns _
    Inherits Collection
'Usage
Dim instance As Columns
[GuidAttribute("914934C4-5A91-11CF-8700-00AA0060263B")]
public interface Columns : Collection

Examples

Use the Columns property to return the Columns collection. This example finds the first table in the active presentation, counts the number of Column objects in the Columns collection, and displays information to the user.

Dim ColCount, sl, sh As Integer



With ActivePresentation

    For sl = 1 To .Slides.Count

        For sh = 1 To .Slides(sl).Shapes.Count

            If .Slides(sl).Shapes(sh).HasTable Then

                ColCount = .Slides(sl).Shapes(sh) _

                    .Table.Columns.Count

                MsgBox "Shape " & sh & " on slide " & sl & _

                    " contains the first table and has " & _

                    ColCount & " columns."

                Exit Sub

            End If

        Next

    Next

End With

Use the Add(Int32) method to add a column to a table. This example creates a column in an existing table and sets the width of the new column to 72 points (one inch).

With ActivePresentation.Slides(2).Shapes(5).Table

    .Columns.Add.Width = 72

End With

Use Columns(index) to return a single Column object. Index represents the position of the column in the Columns collection (usually counting from left to right; although the TableDirection property can reverse this). This example selects the first column of the table in shape five on the second slide.

ActivePresentation.Slides(2).Shapes(5).Table.Columns(1).Select

See Also

Reference

Columns Members

Microsoft.Office.Interop.PowerPoint Namespace