TextFrame.HasText property (PowerPoint)

Returns whether the specified shape has text associated with it. Read-only.

Syntax

expression.HasText

expression A variable that represents a TextFrame object.

Return value

MsoTriState

Remarks

The value of the HasText property can be one of these MsoTriState constants.

Constant Description
msoFalse The specified shape does not have text associated with it.
msoTrue The specified shape has text associated with it.

Example

If shape two on myDocument contains text, this example resizes the shape to fit the text.

Set myDocument = ActivePresentation.Slides(1)

With myDocument.Shapes(2).TextFrame

    If .HasText Then .AutoSize = ppAutoSizeShapeToFitText

End With

See also

TextFrame Object

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.