Question re. use of animation rebuild VBA

  • Follow


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
0
Reply Utf 5/4/2010 11:09:01 PM

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.


-- 
Regards,
Shyam Pillai
Handout Wizard: http://skp.mvps.org/how. PowerPoint 2010 (32-bit/64-bit) 
versions supported.


"RJ" <RJ@discussions.microsoft.com> wrote in message 
news:3714377B-56B6-4BEF-AB87-72677923C42E@microsoft.com...
> 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 

0
Reply Shyam 5/4/2010 11:25:55 PM


You might find this useful -
PPT2000: How to Use VBA Events to Reset Slide Builds
http://support.microsoft.com/kb/276353


-- 
Regards,
Shyam Pillai
Handout Wizard: http://skp.mvps.org/how. PowerPoint 2010 (32-bit/64-bit) 
versions supported.

"RJ" <RJ@discussions.microsoft.com> wrote in message 
news:3714377B-56B6-4BEF-AB87-72677923C42E@microsoft.com...
> 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 

0
Reply Shyam 5/4/2010 11:30:48 PM

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


"Shyam Pillai" wrote:

> You might find this useful -
> PPT2000: How to Use VBA Events to Reset Slide Builds
> http://support.microsoft.com/kb/276353
> 
> 
> -- 
> Regards,
> Shyam Pillai
> Handout Wizard: http://skp.mvps.org/how. PowerPoint 2010 (32-bit/64-bit) 
> versions supported.
> 
> "RJ" <RJ@discussions.microsoft.com> wrote in message 
> news:3714377B-56B6-4BEF-AB87-72677923C42E@microsoft.com...
> > 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 
> 
0
Reply Utf 5/5/2010 12:43:01 AM

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

On 5/4/10 8:43 PM, RJ wrote:
> 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
0
Reply David 5/5/2010 2:36:46 PM

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


"David Marcovitz" wrote:

> 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
> 
> On 5/4/10 8:43 PM, RJ wrote:
> > 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
> .
> 
0
Reply Utf 5/5/2010 3:57:01 PM

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

On 5/5/10 11:57 AM, RJ wrote:
> 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
0
Reply David 5/5/2010 4:03:59 PM

Thanks very much David. You were very helpful.
-- 
RJ


"David Marcovitz" wrote:

> 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
> 
> On 5/5/10 11:57 AM, RJ wrote:
> > 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
> .
> 
0
Reply Utf 5/5/2010 6:26:04 PM

7 Replies
295 Views

(page loaded in 1.37 seconds)

Similiar Articles:
















7/26/2012 8:59:16 PM


Reply: