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