Is there a way to refresh every slide in the slide show using vba. I found
the follow that will refresh the current slide but I need every slide to
refresh/reset. I also realize I can put a blank slide between each slide
with animation set to zero but that will make my show have a lot more slides
than I really want.
Sub RefreshSlide()
Dim lSlideIndex As Long
lSlideIndex = SlideShowWindows(1).View.CurrentShowPosition
SlideShowWindows(1).View.GotoSlide lSlideIndex
End Sub
Actually, that code is used to refresh a slide only in that if things
that were supposed to be drawn didn't get draw, this would redraw them
(sometimes). This sometimes works when you change the value of .Visible,
but the shape doesn't disappear. This does not, however, reset the
animation. Fortunately, with a parameter for GotoSlide, you can reset
the animation.
SlideShowWindows(1).View.GotoSlide lSlideIndex, msoTrue
Note, a quick search found that the place where you got that code
(
http://skp.mvps.org/ppt00030.htm) has the True in its next code snippet.
Now if you want to reset the animation on every slide, I see two
possibilities (besides the blank slide method that you already
discounted). You can either make all your links to slides via VBA, using
the GotoSlide method with the msoTrue parameter (plain old True also
works fine as well), or you can loop through all your slides with
something like:
For i = 1 To ActivePresentation.Slides.Count
ActivePresentation.SlideShowWindow.View.GotoSlide i, msoTrue
Next i
This seems like an ugly way to do this because it loops through (and
actually goes to) each slide, but it should work.
--David
--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland