Skip to content

Latest commit

 

History

History
93 lines (52 loc) · 1.81 KB

PowerPoint.Table.Columns.md

File metadata and controls

93 lines (52 loc) · 1.81 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Table.Columns property (PowerPoint)
vbapp10.chm622003
vbapp10.chm622003
PowerPoint.Table.Columns
0645fa19-d5a2-1f4c-ae15-9623925d39bc
06/08/2017
medium

Table.Columns property (PowerPoint)

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

Syntax

expression.Columns

expression A variable that represents a Table object.

Return value

Columns

Remarks

For information about returning a single member of a collection, see Returning an object from a collection.

Example

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

Table Object

[!includeSupport and feedback]