how to loop through shapes in powerpoint vba

  • Thread starter Thread starter vicky
  • Start date Start date
V

vicky

hey i have a slide which contains different shapes . i need to loop
through all the shapes and check if any shape contains text. if a
shape contains text then i need grab the value of the text in a
variable.... i am newbie to vba.... this one really has me stumped....
 
one way (looks for text boxes among shapes in Slide 1):

Sub cus()
Dim shape As shape
Dim tekst as String
With ActivePresentation.Slides(1)
.Select
For Each shape In ActivePresentation.Slides(1).Shapes
'MsgBox shape.Name
If shape.Name Like "*Text Box*" Then
shape.Select
tekst = ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Words
End If
Next
End With

End Sub

HIH
 
Back
Top