PDA

View Full Version : [SOLVED:] Select only active slide images



Damffer
05-27-2021, 01:20 PM
Hello everyone

I need your valuable orientation with a request.
Through VBA, i need to select all the images in the active slide but no the text boxes or any other shape.

Thanks!!

John Wilson
05-28-2021, 10:06 PM
See if this does it

Sub Image_select()
Dim osld As Slide
Dim opic As Shape
On Error Resume Next
'active slide make sure a slide is selected
Set osld = ActiveWindow.Selection.SlideRange(1)
'clear any already selected shapes
ActiveWindow.Selection.Unselect
For Each opic In osld.Shapes
'select and do not clear previous selections
If opic.Type = msoPicture Then opic.Select (msoFalse)
If opic.Type = msoPlaceholder Then
If opic.PlaceholderFormat.ContainedType = msoPicture Then opic.Select (msoFalse)
End If
Next opic
End Sub