Log in

View Full Version : Help Finding Image of any possible "type" on slide



brody
10-07-2012, 04:06 PM
I have searched ad nauseam to find this answer but have had no success. In a nutshell, I'm trying to loop through all shapes on a slide and find and images that exist.

The problem I am having is how to recognize an image when it shows up as anything other than the shape.type = msoPicture (13)... For example, some of my slides have images that show up as shape.type = msoPlaceholder (14) and I need to be able to distinguish between an image that shows up as type=14 and a textbox or other shape that is also 14.

I hope that was clear. I tried to simplify it as much as I could. Thank you in advance for your time and consideration!

John Wilson
10-12-2012, 09:09 AM
You should mention which VERSION you have. In later versions you can interrogate ContainedType for placholders

brody
11-09-2012, 04:43 PM
I'm using 2010...

John Wilson
11-10-2012, 07:59 AM
This should get you going with how to use containedtype

Sub Find_Pics()
Dim opic As Shape
Dim strMessage As String
For Each opic In ActivePresentation.Slides(1).Shapes
If opic.Type = msoPicture Then strMessage = strMessage & "Shapes:" & opic.ZOrderPosition & " "
If opic.Type = msoPlaceholder Then
If opic.PlaceholderFormat.ContainedType = msoPicture Then strMessage = strMessage & "Shapes:" & opic.ZOrderPosition & " "
End If
Next opic
MsgBox "On this slide these shapes are pictures > " & strMessage
End Sub