Loop through types of shapes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to export some information from a PPT file to a text file. I want
something like this:

For each slide:
Get the slide index (I can do this part)
Get the slide title (I can do this part)
Loop through all of the shapes on the slide and:
(1) For each shape.Type = msoPicture, get the Alternative Text property
(2) For each shape.PlaceholderFormat.Type = ppPlaceholderBody get the Text
property

(My problem is that some slides have more than one shape.Type = msoPicture.
I don't know how to separate the two types of shapes so that I get all of the
pictures and still only get the body text once.)

Build a tab-separated string with each piece of information for each slide
separated by a line return. (I can do this part.)
Export all of this text to a text file. (I can do this part.)

Any suggestions?

(Can I accomplish this by looping through the shapes on the slide view for
each slide and then switching to notes page view to get the body text? Does
the current view matter?)
 
I'm trying to export some information from a PPT file to a text file. I want
something like this:

For each slide:
Get the slide index (I can do this part)
Get the slide title (I can do this part)
Loop through all of the shapes on the slide and:
(1) For each shape.Type = msoPicture, get the Alternative Text property
(2) For each shape.PlaceholderFormat.Type = ppPlaceholderBody get the Text
property

(My problem is that some slides have more than one shape.Type = msoPicture.
I don't know how to separate the two types of shapes so that I get all of the
pictures and still only get the body text once.)


Something like this: (VBA won't ignore the typing errors;
you'll have to do that for it <g>)

For Each oSh in oSl.Shapes
If oSh.PlaceholderFormat.Type = ppPlaceholderBody
' do your stuff
Else
If oSh.Type = msoPicture
' do your other stuff
End If
End If
Next
 
Back
Top