通过一些研究,我在以下网站上看到了这个VBA代码:http://www.pptfaq.com/FAQ00481_Export_the_notes_text_of_a_presentation.htm
Sub ExportNotesText()
Dim oSlides As Slides
Dim oSl As Slide
Dim oSh As Shape
Dim strNotesText As String
Dim strFileName As String
Dim intFileNum As Integer
Dim lngReturn As Long
' Get a filename to store the collected text
strFileName = InputBox("Enter the full path and name of file to extract notes text to", "Output file?")
' did user cancel?
If strFileName = "" Then
Exit Sub
End If
' is the path valid? crude but effective test: try to create the file.
intFileNum = FreeFile()
On Error Resume Next
Open strFileName For Output As intFileNum
If Err.Number <> 0 Then ' we have a problem
MsgBox "Couldn't create the file: " & strFileName & vbCrLf _
& "Please try again."
Exit Sub
End If
Close #intFileNum ' temporarily
' Get the notes text
Set oSlides = ActivePresentation.Slides
For Each oSl In oSlides
For Each oSh In oSl.NotesPage.Shapes
If oSh.PlaceholderFormat.Type = ppPlaceholderBody Then
If oSh.HasTextFrame Then
If oSh.TextFrame.HasText Then
strNotesText = strNotesText & "Slide: " & CStr(oSl.SlideIndex) & vbCrLf _
& oSh.TextFrame.TextRange.Text & vbCrLf & vbCrLf
End If
End If
End If
Next oSh
Next oSl
' now write the text to file
Open strFileName For Output As intFileNum
Print #intFileNum, strNotesText
Close #intFileNum
' show what we've done
lngReturn = Shell("NOTEPAD.EXE " & strFileName, vbNormalFocus)
End Sub
它基本上按幻灯片的时间顺序将所有幻灯片笔记从Powerpoint文件导出到一个文本文件中 .
反正有没有改变代码将幻灯片笔记输出到多个文本文件中?我的意思是,如果powerpoint文档中有4张幻灯片,我们将按如下方式导出每张幻灯片的注释:
-
slide1notes.txt
-
slide2notes.txt
-
slide3notes.txt
-
slide4notes.txt
非常感谢 .
3 回答
如果有人需要一个txt文件中的输出:
由于Mac PPT / VBA出现了错误,这里是Mac的新版本 . 由于我在PC上执行此操作并且无法复制/粘贴到Mac上,因此我没有在Mac上运行代码,但它应该没问题:
我没有太多的时间去做空信码,但是: