PC Review


Reply
Thread Tools Rate Thread

Powerpoint Animation sequence VBA

 
 
Silvester
Guest
Posts: n/a
 
      1st Jun 2006
I am looking to automate powerpoint from Access uing VBA code.

I am not sure how to animate shapes and animation sequencing.

I would like to display a slide and then animate a rectangle to crawl in
from the bottom, some text to crawl right to left & disappear off the left,
rectangle to crawl out downwards.

I found this code on
http://msdn.microsoft.com/library/de...ce02072002.asp

Can someone please help me doctor it to suit ? I do not need the
interactivity/user click triggers...

Thanks very much...


Public Sub CreateAnimatedPresentation()

' Purpose: Creates a PowerPoint presentation,
' adds a slide and two shapes to the slide,
' animates the shapes, and runs the slide show.

Dim ppApp As PowerPoint.Application
Dim objPres As PowerPoint.Presentation
Dim objSlide As PowerPoint.Slide
Dim objSquareShape As PowerPoint.Shape
Dim objTriangleShape As PowerPoint.Shape
Dim objSequence As PowerPoint.Sequence

Set ppApp = New PowerPoint.Application

' Create a new PowerPoint presentation.
Set objPres = ppApp.Presentations.Add

' Add a slide to the presentation.
Set objSlide = objPres.Slides.Add(Index:=1, _
Layout:=ppLayoutBlank)

' Place two shapes on the slide.
Set objSquareShape = objSlide.Shapes.AddShape _
(Type:=msoShapeRectangle, Left:=0, Top:=0, _
Width:=100, Height:=100)
Set objTriangleShape = objSlide.Shapes.AddShape _
(Type:=msoShapeRightTriangle, Left:=0, Top:=150, _
Width:=100, Height:=100)

' Add text to the shapes.
objSquareShape.TextFrame.TextRange.Text = "Click Me!"
objTriangleShape.TextFrame.TextRange.Text = "Me Too!"

' Animate the two shapes.
Set objSequence = objSlide.TimeLine.InteractiveSequences.Add _
(Index:=1)

With objSequence
.AddEffect Shape:=objSquareShape, _
effectID:=msoAnimEffectPathStairsDown, _
trigger:=msoAnimTriggerOnShapeClick
.AddEffect Shape:=objTriangleShape, _
effectID:=msoAnimEffectPathHorizontalFigure8, _
trigger:=msoAnimTriggerOnShapeClick
End With

' Save the presentation and run the slide show.
objPres.SaveAs FileName:="C:\Dancing Shapes.ppt"
objPres.SlideShowSettings.Run

End Sub


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Randomize the animation sequence Alexf Microsoft Powerpoint 4 27th Nov 2008 09:37 PM
Can I sequence custom animation This way? JayneBartram@googlemail.com Microsoft Powerpoint 3 25th Sep 2007 05:56 PM
Handwriting animation sequence checkin.just@gmail.com Microsoft Powerpoint 2 12th Apr 2007 08:13 AM
Can't change animation sequence wayne Microsoft Powerpoint 2 9th Jan 2004 08:11 PM
PowerPoint XP Custom Animation Sequence Loop RWR Microsoft Powerpoint 0 26th Aug 2003 04:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:22 AM.