Bewerken

Delen via


Shape.HasTable property (Publisher)

Returns msoTrue if the shape represents a Table object, or msoFalse if the shape represents any other object type. Read-only.

Syntax

expression.HasTable

expression A variable that represents a Shape object.

Remarks

The HasTable property value can be one of the MsoTriState constants declared in the Microsoft Office type library and shown in the following table.

Constant Description
msoFalse The shapes in the range don't represent a Table object.
msoTriStateMixed Indicates a combination of msoTrue and msoFalse for the specified shape range.
msoTrue The shapes in the range represent a Table object.

Example

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

Sub IsTable() 
 
 With Application.Selection.ShapeRange 
 If .HasTable = msoTrue Then 
 .Table.Columns(1).Width = 72 
 End If 
 End With 
 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.