Select Page

Sometimes you find you need to remove the comments from your PowerPoint presentation before distributing to your audience. But what if you want to keep a permanent copy of them?

The VBA macro below exports all of your PowerPoint slide notes to a plain text file.

To use the macro, press Alt+F11 in PowerPoint and right click on the VBA project to insert a module before copying and pasting the code from below. You can then run it from within the VBE (Visual Basic Editor) or by pressing Alt+F8 in PowerPoint or by assigning the macro to an object on your slide as an Action.

Sub SaveNotesToFile()
  Dim oSld As Slide
  Dim sFileName As String
  Dim sDivider As String
  Dim sSlideNote As String
  Dim iReturnPos As Integer
  Dim sLine As String

  ' Change this to your required file or use a file system object to get a folder
  sFileName = "C:\Temp\SlideNotes.txt"
   
  ' Open a text file ready for writing to
  Open sFileName For Output As #1
    With ActivePresentation
      ' Write the presentation name as the file header
      Print #1, "Presentation : " & .FullName
      sDivider = String(Len("Presentation : " & .FullName), "=")
      Print #1, sDivider
    End With
   
  ' Treat each slide in the presentation
  For Each oSld In ActivePresentation.Slides
    ' Write a label (could also include slide title with more code)
    Print #1, "[SLIDE " & oSld.slideIndex & " NOTES]"
    ' Get the slide note text
    sSlideNote = oSld.NotesPage.Shapes.Placeholders(2).TextFrame.TextRange.Text
    ' Replace carriage return characters with a CR + LF so that multiple lines get output correctly
    sSlideNote = Replace(sSlideNote, Chr(13), vbCrLf)
    ' Output the slide note to the text file
    Print #1, sSlideNote
    Print #1, sDivider
  Next
   
  Close #1
  Shell "explorer.exe /root,C:\Temp\SlideNotes.txt", vbNormalFocus
End Sub