PowerPoint) (表对象

代表一个幻灯片上的表格形状。 Table 对象是 Shapes 集合的成员。 Table 对象中包含 的列 收集和 行 集合。

示例

使用 形状 (索引) ,其中 index 是一个数字,可返回包含表格的形状。 使用 HasTable属性查看形状是否包含表。 本示例遍历检查以查看是否每个形状都含有表格,然后设置鼠标单击动作为前进到下一张幻灯片的每个表格形状的一张幻灯片上的形状。

With ActivePresentation.Slides(2).Shapes

    For i = 1 To .Count

        If .Item(i).HasTable Then

            .Item(i).ActionSettings(ppMouseClick) _

                .Action = ppActionNextSlide

        End If

    Next

End With

使用单元格的 要访问的每个单元格的内容的 表 对象的方法。 本示例将文本"Cell 1"插入第三张幻灯片上第五个形状中表格的第一个单元格。

ActivePresentation.Slides(3).Shapes(5).Table _

    .Cell(1, 1).Shape.TextFrame.TextRange _

    .Text = "Cell 1"

使用AddTable要向幻灯片中添加一个表的方法。 本示例在当前演示文稿第二张幻灯片上添加一个 3 x 3 表格。

ActivePresentation.Slides(2).Shapes.AddTable(3, 3)

方法

名称
ApplyStyle
Cell
ScaleProportionally

属性

名称
AlternativeText
Application
Background
列
FirstCol
FirstRow
HorizBanding
LastCol
LastRow
Parent
Rows
样式
TableDirection
标题
VertBanding

另请参阅

PowerPoint 对象模型引用

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。