tjoindigo
asked on
Powerpoint VBA code for moving to next/previous slide from WITHIN the notes window
Hi,
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
.Panes(2).Activate
End If
End With
ActivePresentation.Slides( ActiveWind ow.Selecti on.SlideRa nge(1).Sli deIndex + 1).Select
DoEvents
With ActiveWindow
If .ViewType = ppViewNormal Then
.Panes(ppViewNotesPage).Ac tivate
End If
End With
Any ideas on how to get this working would be really, really appreciated. At least by me :)
Thanks!
TJ
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
.Panes(2).Activate
End If
End With
ActivePresentation.Slides(
DoEvents
With ActiveWindow
If .ViewType = ppViewNormal Then
.Panes(ppViewNotesPage).Ac
End If
End With
Any ideas on how to get this working would be really, really appreciated. At least by me :)
Thanks!
TJ
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
ASKER
Thanks, Jamie! :)
Your solution is much faster, which helps.
Your solution is much faster, which helps.
ASKER
Thanks so much.