Start Again as New

P

Preschool Mike

On the last slide of my game I have a button the player can click if they
want to chose to play the game again. My problem is when they chose to play
the game again ppt displays each slide as it was the last time the game was
played (e.g., pictures that are suppose to be hidden are visible). I'm not
sure but I'm guessing that ppt is recalling these slides from memory. I've
tried the trick at inserting blank slides between each of my slides and this
works great for my animations but not for the issue at hand. My code works
great when playing the game on a first run, so I don't think it's the
problem. Is there a way to make ppt play (start again) as though it's the
first time the game is played.

Mike
 
P

Preschool Mike

Thanks again for the help. I made some changes to my original game and
decided to go in an opposite direction that works but not when I replay the
game. To answer your question though the "start again" does run a code to
unhide the necessary shapes/pictures. My start again code:
Sub StartAgain()
ActivePresentation.SlideShowWindow.View.GotoSlide (1)
ShowShapesRestart
End Sub

Sub ShowShapesRestart()
Dim oSld As Slide
On Error Resume Next

For Each oSld In ActivePresentation.Slides
oSld.Shapes("walletCover").Visible = msoTrue
oSld.Shapes("moneyCover").Visible = msoTrue
oSld.Shapes("bananaCover").Visible = msoTrue
oSld.Shapes("bucketCover").Visible = msoTrue
oSld.Shapes("cupCover").Visible = msoTrue
oSld.Shapes("eggCover").Visible = msoTrue
oSld.Shapes("keyCover").Visible = msoTrue
oSld.Shapes("keyhole").Visible = msoTrue
oSld.Shapes("moneyFarm").Visible = msoTrue
oSld.Shapes("bananaStore").Visible = msoTrue
oSld.Shapes("bucketMountain").Visible = msoTrue
oSld.Shapes("cupLake").Visible = msoTrue
oSld.Shapes("eggDesert").Visible = msoTrue
oSld.Shapes("keyJungle").Visible = msoTrue
Next
 
P

Preschool Mike

Thanks again for the help. I made some changes to my original game and
decided to go in an opposite direction that works but not when I replay the
game. To answer your question though the "start again" does run a code to
unhide the necessary shapes/pictures. My start again code:
Sub StartAgain()
ActivePresentation.SlideShowWindow.View.GotoSlide (1)
ShowShapesRestart
End Sub

Sub ShowShapesRestart()
Dim oSld As Slide
On Error Resume Next

For Each oSld In ActivePresentation.Slides
oSld.Shapes("walletCover").Visible = msoTrue
oSld.Shapes("moneyCover").Visible = msoTrue
oSld.Shapes("bananaCover").Visible = msoTrue
oSld.Shapes("bucketCover").Visible = msoTrue
oSld.Shapes("cupCover").Visible = msoTrue
oSld.Shapes("eggCover").Visible = msoTrue
oSld.Shapes("keyCover").Visible = msoTrue
oSld.Shapes("keyhole").Visible = msoTrue
oSld.Shapes("moneyFarm").Visible = msoTrue
oSld.Shapes("bananaStore").Visible = msoTrue
oSld.Shapes("bucketMountain").Visible = msoTrue
oSld.Shapes("cupLake").Visible = msoTrue
oSld.Shapes("eggDesert").Visible = msoTrue
oSld.Shapes("keyJungle").Visible = msoTrue
Next
 
C

Chirag

You can start the slide show again using the following code:

Sub StartSlideShowAgain()
Dim Pres As Presentation

Set Pres = SlideShowWindows(1).Presentation
SlideShowWindows(1).View.Exit
Pres.SlideShowSettings.Run
End Sub

This macro should be called from a slide show and it causes that slide show
to exit and start again.

- Chirag

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

David Marcovitz

Chirag's solution is a good one, but I'm still concerned about why your
"reset" code doesn't work. You'll notice that in all my examples I have an
Initialize procedure that runs all the resetting code to hide and unhide
shapes and initialize variables to get the slide looking like they should.
It should work the way I do it or with your reset procedure.

I'm also curious, when you run Chirag's code, does it ask you if you want to
save the presentation?

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

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