Link to home
Start Free TrialLog in
Avatar of tjoindigo

asked on

Powerpoint VBA code for moving to next/previous slide from WITHIN the notes window


When editing the notes of my slides, I want to use a keyboard shortcut to easily move to the next or previous slide. There is no default shortcut key to do that, as far as I can find.

Right now I press F6, Down, Shift+F6. That is way to tedious for me :)

So I tried to create a macro to do this. That way, I can assign a shortcut key to that macro (like Alt+1).
Unfortunately, I cannot get this macro to work.

The easiest solution would be SendKeys "{F6}{PGDN}+{F6}". However, when I execute that macro, I end up in the notes pane of the slide that I was working on, not the next slide.

The same happens with this more elaborate macro:

With ActiveWindow
     If .ViewType = ppViewNormal And _
             .ActivePane.ViewType = ppViewNotesPage Then
     End If
 End With

 ActivePresentation.Slides(ActiveWindow.Selection.SlideRange(1).SlideIndex + 1).Select


 With ActiveWindow
     If .ViewType = ppViewNormal Then
     End If
 End With

Any ideas on how to get this working would be really, really appreciated. At least by me :)

Avatar of Rgonzo1971

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tjoindigo


Awesome, that works.
Thanks so much.
I know you've accepted a solution now but as I just wrote this in parallel, I may as well post it!

Option Explicit

Sub GotoNextSlideNote()
  Dim lCurSlide As Long
  With ActiveWindow
    If .ViewType = ppViewNormal And .ActivePane.ViewType = ppViewNotesPage Then .Panes(2).Activate
  End With
  With ActiveWindow
    With .View
      lCurSlide = .Slide.SlideIndex
      If lCurSlide < ActivePresentation.Slides.Count Then .GotoSlide (lCurSlide + 1) Else .GotoSlide (1)
    End With
    If .ViewType = ppViewNormal Then .Panes(ppViewNotesPage).Activate
  End With
End Sub

Open in new window

Thanks, Jamie! :)
Your solution is much faster, which helps.