Refresh Slide Show

P

Preschool Mike

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
 
D

David Marcovitz

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
 
C

Chirag

The RefreshSlide() code is required for current slide for cases where the
updates to the current slide are not reflected in the slide show. The
updates to the other slides are usually applied and shown when you navigate
to those slides. Are you facing an issue where the updates to other slides
are not shown?

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
P

Preschool Mike

Actually what I'm working with is changing the fill color of a shape using
vba. I don't know if that's considered an animation or property. I'm trying
to reset the fill color of the shape back to what it was originally but it's
not working, at least in slide show view. I working on a jeopardy game using
a smart board and trying to accomplish a buzz in feature where two players
actually have to buzz in to answer the question. I've created two buttons
where the first person to touch their button (run their code) it will cancel
the others code from running. Here's what I've got, maybe reading what I've
quoted out will better explain. I may be asking a lot and if all else fails
I do know the tried and true method of inserting slides between each slide
does work.


Dim T1Tmr As Boolean
Dim T2Tmr As Boolean

'With smart board if team 1 touches first it cancels
'ability for team 2 code to run. The shape above
'their buzz in button lights up indicating they were
'first to buzz. Then countdown starts and they
'have 5 seconds to answer question
Sub T1Buzz_In()
Dim oSld As Slide
On Error Resume Next
For Each oSld In ActivePresentation.Slides
T2Tmr = False
If T1Tmr = True Then
oSld.Shapes("T1Light").Fill.ForeColor.RGB = vbYellow
End If
Next
On Error GoTo 0
If T1Tmr = True Then CountDown
End Sub

'same situation as above but opposite results
Sub T2Buzz_In()
Dim oSld As Slide
On Error Resume Next
For Each oSld In ActivePresentation.Slides
T1Tmr = False
If T2Tmr = True Then
oSld.Shapes("T2Light").Fill.ForeColor.RGB = vbYellow
End If
Next
On Error GoTo 0
If T2Tmr = True Then CountDown
End Sub

'Awarding the points. A separate button is assigned for this code.
'If team 1 was the first to buzz
'they will get the points and this should reset their
'buzz in light back to white and go back to the main
'game screen to prepare for the next question. When a
'new question is selected we are directed to another slide
'however their buzz in light is still yellow. If I exit slide show view
'though the light is white.
Sub Points_100()
If T1Tmr = True Then
Team1Points = Team1Points + 100
ActivePresentation.Slides(2).Shapes("Team1Score") _
..TextFrame.TextRange.Text = Team1Points
ElseIf T2Tmr = True Then
Team2Points = Team2Points + 100
ActivePresentation.Slides(2).Shapes("Team2Score") _
..TextFrame.TextRange.Text = Team2Points
End If
ResetTeam_Buzz
ActivePresentation.SlideShowWindow.View.GotoSlide (2)
End Sub

'suppose to reset the ability to buzz in back to ture (this does work)
'and reset the light back to white (this does not work)
Sub ResetTeam_Buzz()
Dim oSld As Slide
On Error Resume Next
For Each oSld In ActivePresentation.Slides
T1Tmr = True
T2Tmr = True
oSld.Shapes("T1Light").Fill.ForeColor.RGB = vbWhite
oSld.Shapes("T2Light").Fill.ForeColor.RGB = vbWhite
Next
On Error GoTo 0
End Sub

Thanks again,
 
P

Preschool Mike

Actually the issue may be with how I've written my code. The code changes
the fill color of the shape("T1Light") or ("T2Light") depending on the case,
which is on every slide. I run another macro to reset those fill colors back
to white but they don't in slide show view. My code is in my previous post.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top