4

I already know of two supposed fixes, which I will list below, along with the reason they don't work for me.

The first is to use the SlideShowNextSlide subroutine. The problem with this is that it fires the event before the transition, so I have no way of knowing which slide is being transitioned to. I want the event to fire upon entering certain slides during a presentation, not leaving certain slides. I can't simply add one to the CurrentShowPosition field because I'm not necessarily advancing to the next slide; I might click a hyperlink. In short, I want to only fire the events upon some transitions from the current slide, but with SlideShowNextSlide I have no way of knowing if I am moving to the right slide to fire the event.

The second is to use the OnSlideShowPageChange subroutine. The problem with this is that, since I have already saved, closed and reopened my PowerPoint slide show once, PowerPoint simply decides to ignore the code in the subroutine.

Does anyone have any suggestions about what I can do? Maybe a way to fix one of the aforementioned problems? I'm using PowerPoint 2013 on Windows 8.1.

Here's the code I want to use:

Private Sub EventHandler_SlideShowNextSlide(ByVal SSW As SlideShowWindow)
' The purpose here is to stop music playing in the background, which happens on certain slides.
' For my purposes, it's not enough to simply state how many slides to play the music over,
' because some slides that need the music stopped can occur before slides that need it playing.
Dim Change As Boolean
If SSW.View.CurrentShowPosition < 66 And ((SSW.View.CurrentShowPosition < 42 And SSW.View.CurrentShowPosition > 25) Or SSW.View.CurrentShowPosition Mod 2 = 0) _
Then
    ActivePresentation.Slides(1).Shapes("music file.mp3").Delete
    Change = True
End If
If Change Then Application.CommandBars.ExecuteMso "Undo"
End Sub

1 Answer 1

0
Dim CS As Slide
Set CS = ActivePresentation.SlideShowWindow.View.Slide

If CS.SlideIndex < 66 And CS.SlideIndex > 25 Then
'''
End If

I try to verify if I am in the required slide via SlideIndex and then run an If Condition

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .