PPT 2003/2007: How to identify all slides containing custom animat

D

Dave Jenkins

I have a requirement to list for my users the number of all their slides that
contain custom animations. (Not the *count* of such slides, but the
slidenumbers themsleves.)

The following code fails in PPT 2007 and 2003 as well-- it doesn't recognize
a slide whose animation consists solely of a Disappear effect. To test this,
create a perfectly blank slide (makes debugging easier) and insert a textbox
containing something. Create an animation step that will Disappear the text
box on a mouse click. Now run this code:

dim slidenums as new collection

For i = 1 To ActivePresentation.Slides.Count
For j = 1 To ActivePresentation.Slides(i).Shapes.Count
If ActivePresentation.Slides(i).Shapes(j).AnimationSettings.Animate =
msoTrue Then
slideNums.Add ActivePresentation.Slides(i).SlideNumber
Exit For
End If
Next j
Next i

' now display the slide numbers in a message box
If slideNums.Count = 0 Then
MsgBox "No slides with animation found", vbOKOnly, "Animated Slides"
else
' i had some code here to display the slide numbers. It's not germane.
end if

I get the "No slides ..." message in such cases.

Interestingly, if the Disappear is followed by an Appear, the code manages
to identify the slide.

So - is there a way to find such slides? How? PowerPoint clearly knows how
to do it - how can I?
 
J

John Wilson

Hi Dave
You should never use .animation settings with versions after 2000, it is
there simply for backwards compatability. There are no exit animation in 200
which is why disappear is not recognised

To get what you need use the timeline object

eg

If osld.TimeLine.MainSequence.Count >0 then
If osld.TimeLine.InteractiveSequences.Count > 0 then 'triggered animations
count
--
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top