Shape.HasTable 属性 (PowerPoint)Shape.HasTable Property (PowerPoint)

返回指定的形状是否为表。Returns whether the specified shape is a table. 只读。Read-only.


expressionexpression. HasTable

_表达式_代表Shape对象的变量。expression A variable that represents a Shape object.

返回值Return value



HasTable属性的值可以是下列MsoTriState常量之一。The value of the HasTable property can be one of these MsoTriState constants.

常量Constant 说明Description
msoFalsemsoFalse 指定的形状不是表。The specified shape is not a table.
msoTruemsoTrue 指定的形状是表。The specified shape is a table.


以下示例检查当前选定的形状是否为表格。This example checks the currently selected shape to see if it is a table. 如果是表格,此代码将第一列的宽度设置为 1 英寸(72 磅)。If it is, the code sets the width of column one to one inch (72 points).

With ActiveWindow.Selection.ShapeRange

    If .HasTable = msoTrue Then

       .Table.Columns(1).Width = 72

    End If

End With

另请参阅See also

形状对象Shape Object