Table of contents
TOC
折叠目录
展开目录

表对象 (PowerPoint)Table Object (PowerPoint)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

代表一个幻灯片上的表格形状。Table对象是Shapes集合的成员。Table对象包含集合和集合。Represents a table shape on a slide. The Table object is a member of the Shapes collection. The Table object contains the Columns collection and the Rows collection.

示例Example

使用形状(索引),其中索引是一个数字,返回包含的表格形状。使用HasTable属性以查看形状是否包含表格。本示例遍历检查以查看是否每个形状都含有表格,然后设置鼠标单击动作为前进到下一张幻灯片的每个表格形状的一张幻灯片上的形状。Use Shapes (index), where index is a number, to return a shape containing a table. Use theHasTableproperty to see if a shape contains a table. This example walks through the shapes on slide one, checks to see if each shape has a table, and then sets the mouse click action for each table shape to advance to the next slide.

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

使用Table对象的单元方法来访问每个单元格的内容。本示例将文本"Cell 1"插入第三张幻灯片上第五个形状中表格的第一个单元格。Use the Cellmethod of the Table object to access the contents of each cell. This example inserts the text "Cell 1" in the first cell of the table in shape five on slide three.

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

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

    .Text = "Cell 1"

使用AddTable方法来向幻灯片中添加一个表。本示例在当前演示文稿第二张幻灯片上添加一个 3 x 3 表格。Use the AddTablemethod to add a table to a slide. This example adds a 3x3 table on slide two in the active presentation.

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

方法Methods

名称Name
ApplyStyleApplyStyle
单元格Cell
ScaleProportionallyScaleProportionally

属性Properties

名称Name
AlternativeTextAlternativeText
ApplicationApplication
BackgroundBackground
ColumnsColumns
FirstColFirstCol
FirstRowFirstRow
HorizBandingHorizBanding
LastColLastCol
LastRowLastRow
ParentParent
RowsRows
样式Style
TableDirectionTableDirection
标题Title
VertBandingVertBanding

另请参阅See also

其他资源Other resources

PowerPoint 对象模型引用PowerPoint Object Model Reference

© 2018 Microsoft