1

This code works brilliantly for automatically returning the viewer from Slide 3 to 'previous slide viewed' but it seems to only be applicable to one slide. For example, I want to apply it to every odd numbered slide in index (ie 3,5,7,9,11, etc) but then it stops working...

Sub OnSlideShowPageChange()
With ActivePresentation.SlideShowSettings
    .LoopUntilStopped = msoCTrue
    .AdvanceMode = ppSlideShowUseSlideTimings
    .ShowType = ppShowTypeWindow
    .Run
   End With
   
    Dim i As Integer
    i = ActivePresentation.SlideShowWindow.View.CurrentShowPosition
    If Not i = 3 Then Exit Sub
    With SlideShowWindows(1).View

     .GotoSlide (.LastSlideViewed.SlideIndex), msoFalse
    End With

End Sub

Any help would be greatly appreciated!

1 Answer 1

1

So I didn't code vba for some years but if I understand your snippet correctly it e.g. stops the presentation from advancing from page 2 to page 3 (by sending the presentation to the previous page)

if you now want to apply this to every odd page you could rewrite line 11 to:

If Not i Mod 2 > 0 Then Exit Sub

it works for me. please correct me if I understood the task wrong.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes that works very nicely with my code! Thank you, Nikita Meier!
Glad I could help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.