Find number of animations on a slide using VB

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

Guest

Hi, using ppt 2003.
I need to find out the number of animations on a slide using vb code when I
move to that slide.
Is this possible?????
Help me please!!!!
 
The following code will count how many shapes have animations on the
current slide. However, if a shape has more than one animation, it will
not count it twice. Is this helpful?

Sub CountAnim()
Dim shp As Shape
Dim numAnimations As Long

numAnimations = 0
For Each shp In ActivePresentation.SlideShowWindow.View.Slide.Shapes
If shp.AnimationSettings.Animate = msoTrue Then
numAnimations = numAnimations + 1
End If
Next
MsgBox numAnimations
End Sub


--
David M. Marcovitz
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
You can also find the number of manual animation triggers (animation clicks)
by using:

Sub AnimationsPerSlide()
Dim Seqs, TrigCount As Integer

Sld = 1 ' Change to slide # to be evaluated

With ActivePresentation.Slides(Sld).TimeLine
For Seqs = 1 To .MainSequence.Count
If .MainSequence(Seqs).Timing _
.TriggerType = 1 _
Then TrigCount = TrigCount + 1
Next Seqs
End With
MsgBox TrigCount

End Sub


--
Bill Dilworth
Microsoft PPT MVP Team
===============
Please spend a few minutes checking vestprog2@
out www.pptfaq.com This link will yahoo.
answer most of our questions, before com
you think to ask them.

Change org to com to defuse anti-spam,
ant-virus, anti-nuisance misdirection.
..
..
 
Back
Top