Consulting

Results 1 to 4 of 4

Thread: Help Finding Image of any possible "type" on slide

  1. #1
    VBAX Newbie
    Joined
    Jul 2008
    Posts
    3
    Location

    Help Finding Image of any possible "type" on slide

    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!

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    You should mention which VERSION you have. In later versions you can interrogate ContainedType for placholders
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Newbie
    Joined
    Jul 2008
    Posts
    3
    Location
    I'm using 2010...

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    This should get you going with how to use containedtype

    [VBA]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[/VBA]
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •