Share via


Columns._Index Method (Int32)

Returns a Columns collection that represents all the columns in a table. Read-only.

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

Syntax

'Declaration
Function _Index ( _
    Index As Integer _
) As Object
'Usage
Dim instance As Columns
Dim Index As Integer
Dim returnValue As Object

returnValue = instance._Index(Index)
Object _Index(
    int Index
)

Parameters

Return Value

Type: System.Object
Columns

Implements

Collection._Index(Int32)

Remarks

For information about returning a single member of a collection, see [Howto:ReturnObjectsfromCollections#SameCHM].

Examples

This example displays the shape number, the slide number, and the number of columns in the first table of the active presentation.

Dim ColCount As Integer

Dim sl As Integer

Dim 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

This example tests the selected shape to see if it contains a table. If it does, the code sets the width of column one to 72 points (one inch).

With ActiveWindow.Selection.ShapeRange

    If .HasTable = True Then

       .Table.Columns(1).Width = 72

    End If

End With

See Also

Reference

Columns Interface

Columns Members

_Index Overload

Microsoft.Office.Interop.PowerPoint Namespace