Hi all (especially John, happy new year!)
Is there a way to use VBA to clear all footnotes, rather than go FILE > INSPECT DOCUMENT and the tick panel showing? Just a code to remove all footnotes?
Thank you, and for all your help in 2018. Magic :)
Printable View
Hi all (especially John, happy new year!)
Is there a way to use VBA to clear all footnotes, rather than go FILE > INSPECT DOCUMENT and the tick panel showing? Just a code to remove all footnotes?
Thank you, and for all your help in 2018. Magic :)
You need to explain exactly what you mean by 'footnotes'.
Speaker Notes ?
Comments?
Something else?
Hi, sorry John, my fault. I meant to say 'notes' or also known as 'Speaker Notes'.
I've worked it out thanks, and here's the code for anyone reading this:
Sub RemoveSpeakerNotes()
Dim sld As Slide
For Each sld In ActivePresentation.Slides
sld.NotesPage.Shapes.Placeholders
(2).TextFrame.TextRange _
= ""
Next sld
End Sub
Just a note then:
There are rare situations where PlaceHolders(2) is NOT the Notes Text. 99% of the time it will be but it can fail if eg the slide placeholder has been deleted and a footer added. Always check that the placeholder is the correct type (body)
Thank you :) Happy new year
Code:Sub kill_notes()
Dim osld As Slide
For Each osld In ActivePresentation.Slides
getNotes(osld.NotesPage).TextFrame.TextRange = ""
Next osld
End Sub
Function getNotes(npage As Object) As Shape
Dim L As Long
For L = 1 To npage.Shapes.Placeholders.Count
If npage.Shapes.Placeholders(L).PlaceholderFormat.Type = ppPlaceholderBody Then
Set getNotes = npage.Shapes.Placeholders(L)
Exit Function
End If
Next L
End Function