Ok, so basically I need a Macro to restart the animations of the entire PPT Presentation, my game is action packed and has a lot of combat in it, problem is, when You die and fight again some of the animations within the game won't play again until You close and open the game again, this is of course bad and I need help to create a macro that resets all of the animations for all of the slides in the presentation. I coded a Macro that does work, but only works in a very specific and well cluncky way. This is the Macro: Sub Reiniciar()
SlideShowWindows(1).View.ResetSlideTime
SlideShowWindows(1).View.GotoSlide (3)
SlideShowWindows(1).View.GotoSlide (2)
SlideShowWindows(1).View.GotoSlide (1)
End Sub
I've tried using commands like "SlideReset" but these don't seem to work on the newest Power Point versions. I also tried with these codes, I made them myself but don't work. Sub SlidesReset()
For i = 1 To ActivePresentation.Slides.count
ActivePresentation.Slides(i).Select
Application.CommandBars.ExecuteMso ("SlideReset")
DoEvents
Next i
End Sub
Sub RefreshSlide()
Dim lSlideIndex As Long
lSlideIndex = SlideShowWindows(1).View.CurrentShowPosition
SlideShowWindows(1).View.GotoSlide lSlideIndex
End Sub
If You guys could help me fixed this, I would be very thankful of the help provided, and I would put You guys in the Credits of the game as well as providing an early demo version of the game.
Ok that will do the trick, thanks a lot!
Hi Breaker and welcome to the Forum! I see what your problem is and it's surprisingly easy to fix. You need to reset the Slide, there are many ways to do that, with or without Macros. You can place a slide before the slide you want to reset and set it to advance the slide after 0,00 seconds. That's obviously not very handy, so there are 2 other options, but using Macros.
To reset the current slide you are in:
ActivePresentation.SlideShowWindow.View.ResetSlideTime
To reset a slide when you enter it:
ActivePresentation.SlideShowWindow.View.GotoSlide SlideNumber, msoTrue
Replace SlideNumber with the number of the slide. msoTrue tells VBA to reset the slide when entering it.
I hope this helps. If you have any other questions, feel free to ask :)