使用 VBA 宏自动导出备注
-
打开 VBA 编辑器:
按Alt + F11
打开 VBA 编辑器 -
插入新模块:
选择“插入” -> “模块” -
复制并粘贴 VBA 代码:
Sub ExportNotesToWord() Dim pptApp As Object Dim pptPres As Object Dim pptSlide As Object Dim pptNote As Object Dim wordApp As Object Dim wordDoc As Object Dim i As Integer ' Create a new Word application Set wordApp = CreateObject("Word.Application") wordApp.Visible = True Set wordDoc = wordApp.Documents.Add ' Reference the active PowerPoint application Set pptApp = GetObject(, "PowerPoint.Application") Set pptPres = pptApp.ActivePresentation ' Loop through each slide in the presentation For i = 1 To pptPres.Slides.Count Set pptSlide = pptPres.Slides(i) Set pptNote = pptSlide.NotesPage.Shapes.Placeholders(2).TextFrame.TextRange ' Add slide number and notes to the Word document With wordDoc.Content .InsertAfter "Slide " & i & ":" & vbCrLf .InsertAfter pptNote.Text & vbCrLf & vbCrLf End With Next i ' Release the objects Set pptNote = Nothing Set pptSlide = Nothing Set pptPres = Nothing Set pptApp = Nothing Set wordDoc = Nothing Set wordApp = Nothing End Sub
-
运行 VBA 宏:
按F5
键或点击“运行”按钮执行
这段 VBA 宏代码会遍历 PowerPoint 中的每张幻灯片,并将其备注复制到 新创建的Word 文档中