Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / August 2006

Tip: Looking for answers? Try searching our database.

Loop through types of shapes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
caten - 02 Aug 2006 23:41 GMT
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?)
Steve Rindsberg - 03 Aug 2006 04:06 GMT
> I'm trying to export some information from a PPT file to a text file. I want
> something like this:
[quoted text clipped - 10 lines]
> 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

> (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?)

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.