Table of contents
Collapse the table of content
Expand the table of content

Shape.HasTextFrame Property (Publisher)

office 365 dev account|Last Updated: 8/24/2017
3 Contributors

Returns an MsoTriState constant if the specified shape has a TextFrame object associated with it. Read-only.


expression. HasTextFrame

_expression_A variable that represents a Shape object.


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.

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

msoFalseThe specified shape does not have a TextFrame object associated with it.
msoTriStateMixedIndicates a combination of msoTrue and msoFalse for the specified shape range.
msoTrueThe specified shape has a TextFrame object associated with it.


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
© 2018 Microsoft