Question re. use of animation rebuild VBA

  • Thread starter Thread starter RJ
  • Start date Start date
R

RJ

Hello,

I am preparing a interactive ppt for use at a kiosk and would like to
utilize the following VBA code into a macro in order to rebuild animation on
previously viewed slides:

Sub ResetSlide()

' The number after GotoSlide is the slide number.
SlideShowWindows(1).View.GotoSlide 1, msoTrue

End Sub

(Dumb) Q#1: Does the part of the code that says " ' The number after
GotoSlide is the slide number." stay in the code or is that just an
instruction to the code user? Either way, does the (number) need to be
changed for each situation?

Q#2: Where does this macro get inserted? I do not want the user to have to
take an action to rebuild the animation. I would like it done automatically
so that whenever the slide is revisited, the animation will play.

Example: The viewer views slide #3 and then navigates around to different
slides using action buttons. Eventually the viewer (or a subsequent viewer)
returns to slide #3 via another action button. Where is the macro installed?
Can an action button both send a viewer to a particular location AND run the
rebuild macro, or can the macro run automatically somehow after the slide
plays?

Any and all help would be most appreciated.

Thanks!



RJ
 
Hi,
(Dumb) Q#1: Does the part of the code that says " ' The number after
GotoSlide is the slide number." stay in the code or is that just an
instruction to the code user? Either way, does the (number) need to be
changed for each situation?
The number will change based on the slide you want to go to. If you specify
1 it will go to the 1st slide and reset the animations on that slide.
Q#2: Where does this macro get inserted? I do not want the user to have to
take an action to rebuild the animation. I would like it done
automatically
so that whenever the slide is revisited, the animation will play.

The macro gets inserted in a code module. The triggering mechanism would be
either a shape with action setting set to run the macro or called from an
event handler if you want it to be automatic.
Example: The viewer views slide #3 and then navigates around to different
slides using action buttons. Eventually the viewer (or a subsequent
viewer)
returns to slide #3 via another action button. Where is the macro
installed?
Can an action button both send a viewer to a particular location AND run
the
rebuild macro, or can the macro run automatically somehow after the slide
plays?
The macro is sending the user to the 1st slide and resetting the animation.

I would recommend taking a non programmatic approach to reset the
animation - place a dummy slide with auto slide transition of 0 seconds
duration just before the slide with animation. Set the action setting to
jump to the dummy slide. Anytime you enter into a slide the animations will
be reset.
 
Thank you. I have already tried the dummy slide to reset the animation, but
it only seemed to work once, which made me wonder if the 0:00 auto-advance on
the dummy was itself an animation that could only be played once?
 
The dummy slide should work multiple times. It would probably be the
best approach. If you are using VBA, to elaborate on Shyam's answer
(which was exactly right)...

#1 In VBA, a single quote in a line indicates a comment. Anything after
the single quote is ignored by the computer. You can remove any
comments, but they are helpful to the reader of the code (and, in your
case, the modifier of the code).

#2 If you are not using an event handler (which adds another level of
complexity to this), then the code needs to go in a procedure which will
be assigned to a button. Instead of having a regular hyperlink to a
slide, you would have a the button that would have had the hyperlink
link to the procedure that contains that code.

--David

Thank you. I have already tried the dummy slide to reset the animation, but
it only seemed to work once, which made me wonder if the 0:00 auto-advance on
the dummy was itself an animation that could only be played once?


--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
Would it be possible to have code that would both return the slide and
rebuild the animation all in one action button and what would that code look
like?
 
Yes, now that I'm not looking at the original message, I'm not sure, but
I thought that was what the code was that you posted. The GotoSlide
method has two parameters: the slide number to go to and whether or not
to reset the animation on that slide. Something along the lines of:

ActivePresentation.SlideShowWindow.View.GotoSlide 3, msoTrue

says go to slide 3 and reset the animation (msoFalse would not reset the
animation).

--David

Would it be possible to have code that would both return the slide and
rebuild the animation all in one action button and what would that code look
like?


--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
Back
Top