I frequently have to remove speaker notes from presentations and it just occurred to me that a macro could probably do this faster than manual removal.
Can anyone give me a direction to start for how to do this?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS PowerPoint and presentation apps » Remove Speaker Notes (PPT2000 SR1)
I went into the online help for what appeared to be most relevant, the NotesPage property of the Slide object, but it led to a morass, since it returns a SlideRange which I don’t really understand. To find a property I could change, I added a note to my first slide and used this code:
Sub NotesExploration() Dim aSlide As Slide, sldrng As SlideRange For Each aSlide In ActivePresentation.Slides Set sldrng = aSlide.NotesPage Stop 'Now open View|Locals and examine the properties under the sldrng object Next End Sub
Finally came up with this:
Sub NotesPurge() Dim aSlide As Slide For Each aSlide In ActivePresentation.Slides aSlide.NotesPage.Shapes(2).TextFrame.TextRange.Text = vbNullString Next End Sub
Hopefully this works consistently across presentations and configurations, ’cause I wouldn’t want to have to do the more general code to deal with the note not being in the second shape.
Jefferson, the NotesPage property is a great find! Now I need to rewrite all of my macros that deal with notes. However, it seems to be tempermental. Help says, “The NotesPage property returns the notes page for either a single slide or a range of slides.” How can it return a “page” (singular) for “slides” (plural)? Turns out it can’t! The Shapes(2) has always bothered me and I wondered if there was some better way to identify the notes placeholder, so I tried to look at the ActivePresentation.Slides.Range.NotesPage.Shapes collection and got “Automation error The object invoked has disconnected from its clients.” Just the way I feel sometimes! So, I guess we must go one slide at a time. A final note: the Shapes(2) is validated by the help for the SlideRange Collection Object: “placeholder two (the notes area) on the notes page.” Would be nice to have a HasNotes property like the HasTextFrame. Anyway, thanks again for the NotesPage tip! –Sam
Wow! That’s great!!
I have a little VB background and was so confused trying to navigate the PowerPoint macro/vb modules. I am not strong with VB logic. The second code works excellent as a macro and cleans every speaker note from every slide.
I made the macro a PowerPoint Add-in and was successful at adding a new menu option to my PPT Tools menu titled “Purge Notes” and the code executed beautifully.
Thank you for your excellent reply, this has given me an inside look to PPT VB logic.
Below is the final VB module code for the PPA.
I hope others can use it as well
—————————————————–
Sub NotesPurge()
‘ Notes Purge Macro created 6/6/02 by jscher2000 in Woody’s Lounge @ http://www.wopr.com
‘This Sub NotesPurge is excellent as a macro in PPT, all by its self
Dim aSlide As Slide
For Each aSlide In ActivePresentation.Slides
aSlide.NotesPage.Shapes(2).TextFrame.TextRange.Text = vbNullString
Next
End Sub
Sub Auto_Open()
‘Auto Open added by Ryan Woolever, using modified Microsoft online support examples http://www.microsoft.com
‘This adds a toolbar command called Purge Notes when Loading a PP Add-in
Dim NewControl As CommandBarControl
‘ Store an object reference to a command bar.
Dim ToolsMenu As CommandBars
‘ Figure out where to place the menu choice.
Set ToolsMenu = Application.CommandBars
‘ Create the menu choice. The choice is created in the first
‘ position in the Tools menu.
Set NewControl = ToolsMenu(“Tools”).Controls.Add _
(Type:=msoControlButton, _
Before:=1)
‘ Name the command.
NewControl.Caption = “Purge Speaker Notes”
‘ Connect the menu choice to your macro. The OnAction property
‘ should be set to the name of your macro.
NewControl.OnAction = “NotesPurge”
End Sub
Sub Auto_Close()
‘Auto Close added by Ryan Woolever, modified Microsoft online support examples http://www.microsoft.com
‘
Dim oControl As CommandBarControl
Dim ToolsMenu As CommandBars
‘ Get an object reference to a command bar.
Set ToolsMenu = Application.CommandBars
‘ Loop through the commands on the tools menu.
For Each oControl In ToolsMenu(“Tools”).Controls
‘ Check to see whether the comand exists.
If oControl.Caption = “Purge Speaker Notes” Then
‘ Check to see whether action setting is set to NotesPurge.
If oControl.OnAction = “NotesPurge” Then
‘ Remove the command from the menu.
oControl.Delete
End If
End If
Next oControl
End Sub
—————————————————–
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications