PDA

View Full Version : [SOLVED:] How to go to slide and run animation?



jeffwirth
01-13-2022, 11:23 AM
Using VBA, I need to go to a particular slide and run the first animation which is set to run "On click."
Below is the code I've got so far. It runs the PowerPoint show and goes to slide 5, but SendKeys "{DOWN}" doesn't run the first animation.
Any suggestions?


Sub LoadSlideAndRunAnimation()
Application.Activate
ActiveWindow.Panes(1).Activate
Windows(1).View.GoToSlide 5
ActivePresentation.SlideShowSettings.Run
SlideShowWindows(1).View.GoToSlide 5
SlideShowWindows(1).Activate
SendKeys "{DOWN}"
End Sub


I'm working with PowerPoint 2010 on Windows 10.

jeffwirth
01-13-2022, 12:08 PM
OK, so the Next method isn't just for slides. It's also for animations. Here's the code that works:


Application.Activate
ActiveWindow.Panes(1).Activate
Windows(1).View.GoToSlide slideNum
ActivePresentation.SlideShowSettings.Run
SlideShowWindows(1).View.GoToSlide slideNum
SlideShowWindows(1).View.Next