HasTextFrame Property
Applies To
Shape object, ShapeRange collection object.
Description
True if the specified shape has a text frame and can therefore contain text. Read-only Long.
Example
This example extracts text from all shapes on myDocument that contain text frames, and then it stores the names of these shapes and the text they contain in an array.
Dim shpTextArray( ) As Variant
Dim numShapes, numAutoShapes, i As Long
Set myDocument = ActivePresentation.Slides(1)
With myDocument.Shapes
numShapes = .Count
If numShapes > 1 Then
numTextShapes = 0
ReDim autoShpArray(1 To 2, 1 To numShapes)
For i = 1 To numShapes
If .Item(i).HasTextFrame Then
numTextShapes = numTextShapes + 1
shpTextArray(numTextShapes, 1) = .Item(i).Name
shpTextArray(numTextShapes, 2) = .Item(i).TextFrame. _
TextRange.Text
End If
Next
ReDim Preserve shpTextArray(1 To 2, 1 To numAutoShapes)
End If
End With