Consulting

Results 1 to 6 of 6

Thread: Button to remove all footnotes

  1. #1
    VBAX Contributor
    Joined
    Dec 2018
    Location
    South London
    Posts
    115
    Location

    Button to remove all footnotes

    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

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    You need to explain exactly what you mean by 'footnotes'.

    Speaker Notes ?
    Comments?
    Something else?
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Contributor
    Joined
    Dec 2018
    Location
    South London
    Posts
    115
    Location

    Removing Speaker Notes

    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

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    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)
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  5. #5
    VBAX Contributor
    Joined
    Dec 2018
    Location
    South London
    Posts
    115
    Location

    Thanks

    Thank you Happy new year

  6. #6
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    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
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •