constant if the specified shape has a TextFrame object associated with it. Read-only.
MsoTriState can be one of these MsoTriState constants. |
msoCTrue Not used with this property. |
msoFalse The specified shape does not have a TextFrame object associated with it. |
msoTriStateMixed Indicates a combination of msoTrue and msoFalse for the specified shape range. |
msoTriStateToggle Not used with this property. |
msoTrue The specified shape has a TextFrame object associated with it. |
expression.HasTextFrame
expression Required. An expression that returns one of the objects in the Applies To list.
Remarks
If the HasTextFrame property is true, clients must check the value of the HasText property of the TextFrame object to determine if there is any text on the shape.
Example
This example tests all the shapes in the selection and if none have text frames associated with them, they are left aligned.
Sub MoveLeft()
Dim shpAll As ShapeRange
Set shpAll = Application.ActiveDocument.Selection.ShapeRange
If shpAll.HasTextFrame = msoFalse Then
shpAll.Align msoAlignLefts, msoTrue
End If
End Sub