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
Hi,
I tried the above code; however, it doesn’t work. Though it creates a text file, the file just has the following.
Presentation : Presentation1
============================
=== Notes from slide 1 :
============================
=== Notes from slide 2 :
============================
I actually want to export all PPT Comments to an excel sheet. Please let me know if it’s possible.
Thanks,
Yogesh
What version of PowerPoint and Windows are you using? It is technically possible to export to an Excel file.
It’s fixed now Yogesh. IT wasn’t dealing with single line comments but does now. It also open the text file after creating it. You can import the text file into Excel or modify the macro to do that for you.
Hi Jamie,
Thanks for your response. I am now trying to export comments to an Excel Sheet or rather a .csv file and was quite successful in doing it. The slide numbers along with comments were directly exported in the .csv file. However, the .csv file didn’t have good formatting, for example, the columns weren’t appropriately adjusted.
My question is along with exporting the file, can we also define the formatting for the excel file? So that after exporting, one doesn’t need to format the excel file. The user gets a ready made file.
Thanks for your help,
Yogesh
Are you using the modified macro or the G-Tools add-in Yogesh? A CSV file only contains delimited text data and cannot contain formatting (Excel creates some default formatting when it “imports” CSV data to a sheet). So formatting columns, rows, fonts etc. is only possible when saving to an Excel (.xls etc.) formatted file. The G-Tools add-in does some basic formatting but I guess there may be a lot of different formatting needs from different users so it could be difficult to satisfy all needs.
Exporting slide notes to Text, Excel or Word files is now included in our G-Tools add-in. It’s packed with loads of hard-core features so check it out!
http://youpresent.co.uk/products/powerpoint-add-ins/g-tools/