PDA

View Full Version : [SOLVED:] Toggle Speaker Notes



RayKay
01-10-2019, 07:48 AM
Hi John

I've made the below code, because I need a button that toggles the slide (speaker) notes. The text that's below slides, which is in the Notes layout too.

The aim was to have a toggle button, like the default one, to swap between ViewNotesPage and ViewNormal. It's for Office 2013. My VBA is totally wrong :( but hopefully you can help? I'm sure others would find this helpful too. Thank you :content:


Sub EnterSpeakerNotes()
With ActiveWindow
If .ActivePane.ViewType = ppViewNotesPage Then
.Panes(3).Activate
End If
End With
With ActiveWindow
If .ActivePane.ViewType = ppViewNormal Then
.Panes(3).Activate
End If
End With
End Sub

John Wilson
01-10-2019, 08:51 AM
If you mean opoen and close the notes area below the slide then yo have to use ActiveWindow.SplitVertical


Sub toggle()
Select Case ActiveWindow.SplitVertical
Case Is = 100
ActiveWindow.SplitVertical = 90 '90% slide 10% notes
Case Else
ActiveWindow.SplitVertical = 100
End Select
End Sub

RayKay
01-11-2019, 05:00 AM
Hi John

Sorry, I know you're really busy, I should have called it Notes Page. I need two separate toggle buttons please:
(As found on the View tab, 'Notes Page')

1: A toggle button between Notes Page and Normal view

2: A toggle button for Notes Page Layout - Portrait or Landscape

I've looked everywhere :banghead:, my efforts fail, and I didn't bookmark a site with the MS button VBA labels (?)

Many thanks :)

That code was great though, thank you :)

John Wilson
01-12-2019, 02:12 AM
Maybe this will give you somewhere to start


Sub NotesOrient_Toggle()
Dim Orient As Long
Orient = ActivePresentation.PageSetup.NotesOrientation
Select Case Orient
Case 1
ActivePresentation.PageSetup.NotesOrientation = 2
Case 2
ActivePresentation.PageSetup.NotesOrientation = 1
End Select
End Sub


Sub notesToggle()
If ActiveWindow.ViewType = ppViewNotesPage Then
ActiveWindow.ViewType = ppViewNormal
Else
ActiveWindow.ViewType = ppViewNotesPage
End If
End Sub

RayKay
01-14-2019, 07:03 AM
Hi John

Thanks for the code, works great. I just discovered one more toggle, but my code fails :banghead:

Sub ToggleHideSlide()
If ActiveWindow.ViewType = ppViewNormal Then
ActiveWindow.ViewType = ppHideSlide
Else
ActiveWindow.ViewType = ppUnhideSlide
End If
End Sub

Thank you in advance :)

John Wilson
01-14-2019, 11:16 AM
ppHideSlide and ppUnhideSlide are not ViewTypes and will always fail in this context.

RayKay
01-15-2019, 02:26 AM
ppHideSlide and ppUnhideSlide are not ViewTypes and will always fail in this context.

Hi John

Thanks, is this the code I need? To get the Toggle button for Hide and Unhide slide(s).


Sub ToggleHideSlide()
If ActiveWindow.ViewType = ppViewNormal Then
ActiveWindow.ViewType = ppSlideHide
End If
End Sub


Thanks in advance.

John Wilson
01-15-2019, 06:11 AM
No there's no such method as ppSlideHide

If you want to make a slide as hidden


Dim osld As Slide
Set osld = ActiveWindow.Selection.SlideRange(1)
osld.SlideShowTransition.Hidden = False ' Or True