From: lizsantiago on
David, thanks let me tell you that your code works is a pity i cant make it go faster. Do you think this could be mix wioth your code to make it faster
Returns or sets a Single that represents the speed, in seconds, of the specified animation. Read/write.
Syntax

expression.Speed

expression A variable that represents a Timing object.

Example


This example sets the animation for the main sequence to reverse and sets the speed to one second.

Visual Basic for Applications
Sub AnimPoints()
Dim tmlAnim As TimeLine
Dim spdAnim As Timing

Set tmlAnim = ActivePresentation.Slides(1).TimeLine
Set spdAnim = tlnAnim.MainSequence(1).Timing
With spdAnim
.AutoReverse = msoTrue
.Speed = 1
End With
End Sub


Steve, i couldn't make your code work but thanks for all your replies.

---
frmsrcurl: http://msgroups.net/microsoft.public.powerpoint/Please-Heeeeelp-Vba-code-to-add-animation-to-an-existing-object
From: Steve Rindsberg on
In article <eOPjYwy4KHA.5548(a)TK2MSFTNGP04.phx.gbl>, David Marcovitz wrote:
> I can't remember if I was trying this in 2003 or 2007 (I think 2003)
> but I was having problems with the speed. It seemed that no matter what
> I did, every rotation would take about a second.

As in "One second for the whole rotation to occur" or "One second per
iteration of the loop"? (I have to confess, the first time through I plugged
in a way big number for Sleep, forgetting that it might come up randomly with
a really large number of iterations. Task Manager is your Friend.)


I tried Sleep , and
> that just slowed it down more, which is why I dropped it from my code.
> And when I left out the GotoSlide, it wouldn't refresh at all and just
> pause and then randomly show up with something rotated. Initially, I
> imagined this spinning around several times in a few seconds, but I cut
> it down to a maximum rotation of 1 time around so it wouldn't take forever.
> --David
>
> On 4/23/10 1:48 PM, Steve Rindsberg wrote:
> > Your PPT 2007 visibility bug or its cousin?
> >
> > I started with your code and modified it a wee bit ... for all intents
> > and purps it's identical, just a bit more generic. This lets me assign
> > the macro as an action setting on the shape so it acts when clicked on.
> > Works nicely in 2003 ... haven't tried it in
> > bugfest^H^H^H^H^H^H^H2007.
> >
> > Option Explicit
> >
> > Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
> >
> > Sub Spin(oSh As Shape)
> > Dim spinNumber As Long
> > Dim i As Long
> >
> > Randomize
> > spinNumber = 360 * Rnd
> > For i = 1 To spinNumber
> > oSh.IncrementRotation (1)
> > Sleep 1
> > ActivePresentation.SlideShowWindow.View.GotoSlide
> > oSh.Parent.SlideIndex
> > Next i
> >
> > End Sub
> >
> >
> >
> > ==============================
> > PPT Frequently Asked Questions
> > http://www.pptfaq.com/
> >
> > PPTools add-ins for PowerPoint
> > http://www.pptools.com/
> >
> >


==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/


From: David Marcovitz on
That was one second per iteration. I figured I would rotate around 10+
times at 1 degree increments so that is between 3600 and 3960
iterations. At about 1/100th of a second per iteration that would mean
that a spin would take 3 or 4 seconds. As it turned out at 1 second, it
would take over an hour.
--David

On 4/24/10 4:12 PM, Steve Rindsberg wrote:
> In article<eOPjYwy4KHA.5548(a)TK2MSFTNGP04.phx.gbl>, David Marcovitz wrote:
>> I can't remember if I was trying this in 2003 or 2007 (I think 2003)
>> but I was having problems with the speed. It seemed that no matter what
>> I did, every rotation would take about a second.
>
> As in "One second for the whole rotation to occur" or "One second per
> iteration of the loop"? (I have to confess, the first time through I plugged
> in a way big number for Sleep, forgetting that it might come up randomly with
> a really large number of iterations. Task Manager is your Friend.)
>
>
> I tried Sleep , and
>> that just slowed it down more, which is why I dropped it from my code.
>> And when I left out the GotoSlide, it wouldn't refresh at all and just
>> pause and then randomly show up with something rotated. Initially, I
>> imagined this spinning around several times in a few seconds, but I cut
>> it down to a maximum rotation of 1 time around so it wouldn't take forever.
>> --David
>>
>> On 4/23/10 1:48 PM, Steve Rindsberg wrote:
>>> Your PPT 2007 visibility bug or its cousin?
>>>
>>> I started with your code and modified it a wee bit ... for all intents
>>> and purps it's identical, just a bit more generic. This lets me assign
>>> the macro as an action setting on the shape so it acts when clicked on.
>>> Works nicely in 2003 ... haven't tried it in
>>> bugfest^H^H^H^H^H^H^H2007.
>>>
>>> Option Explicit
>>>
>>> Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
>>>
>>> Sub Spin(oSh As Shape)
>>> Dim spinNumber As Long
>>> Dim i As Long
>>>
>>> Randomize
>>> spinNumber = 360 * Rnd
>>> For i = 1 To spinNumber
>>> oSh.IncrementRotation (1)
>>> Sleep 1
>>> ActivePresentation.SlideShowWindow.View.GotoSlide
>>> oSh.Parent.SlideIndex
>>> Next i
>>>
>>> End Sub
>>>
>>>
>>>
>>> ==============================
>>> PPT Frequently Asked Questions
>>> http://www.pptfaq.com/
>>>
>>> PPTools add-ins for PowerPoint
>>> http://www.pptools.com/
>>>
>>>
>
>
> ==============================
> PPT Frequently Asked Questions
> http://www.pptfaq.com/
>
> PPTools add-ins for PowerPoint
> http://www.pptools.com/
>
>


--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
From: David Marcovitz on
Unfortunately, I don't think that this code mixes with my code. My code
doesn't use animations. It just rotates the object. The code you put
here is for real animations. With real animations, you have more control
over the way it looks, but you have no way of knowing where the spinner
ends up.

One way to make it go a bit faster is to have the increment of the
rotation be 2 (or 3) degrees instead of 1.

--David

On 4/23/10 5:59 PM, lizsantiago wrote:
> David, thanks let me tell you that your code works is a pity i cant make it go faster. Do you think this could be mix wioth your code to make it faster
> Returns or sets a Single that represents the speed, in seconds, of the specified animation. Read/write.
> Syntax
>
> expression.Speed
>
> expression A variable that represents a Timing object.
>
> Example
>
>
> This example sets the animation for the main sequence to reverse and sets the speed to one second.
>
> Visual Basic for Applications
> Sub AnimPoints()
> Dim tmlAnim As TimeLine
> Dim spdAnim As Timing
>
> Set tmlAnim = ActivePresentation.Slides(1).TimeLine
> Set spdAnim = tlnAnim.MainSequence(1).Timing
> With spdAnim
> .AutoReverse = msoTrue
> .Speed = 1
> End With
> End Sub
>
>
> Steve, i couldn't make your code work but thanks for all your replies.
>
> ---
> frmsrcurl: http://msgroups.net/microsoft.public.powerpoint/Please-Heeeeelp-Vba-code-to-add-animation-to-an-existing-object


--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
From: lizsantiago on
I finally found something that makes the effect i was looking and i wanted to posted here just in case anyone else might need it.
Sub RndSpin(oShp as Shape)
Dim t As Single
t = Timer + (Rnd * 4) + 1
Do Until Timer > t
oShp.Rotation = oShp.Rotation + 5
DoEvents
Loop
End Sub
thanks everyone for your help!!!!;>

---
frmsrcurl: http://msgroups.net/microsoft.public.powerpoint/Please-Heeeeelp-Vba-code-to-add-animation-to-an-existing-object