使用VBA将PowerPoint注释文本传输到Word文档

时间:2019-03-13 18:52:08

标签: powerpoint

我有一个ppt演示文稿,其中包含30张幻灯片,每张幻灯片都有相应的注释。我想从笔记中提取文本并将其转换为Word文档。下面的代码执行此操作,但是它不会将格式转移到word文档:

将intSlide转换为整数     昏暗的strFileName作为字符串     Dim strTemp作为字符串     昏暗的strNotes作为字符串

strFileName = "C:\Users\XXXX.doc" 

strTemp = MsgBox("Include labels in the text file?", _
vbQuestion + vbYesNoCancel, "Label Treatment")

If strTemp = vbCancel Then Exit Sub

Open strFileName For Output As #1
With ActivePresentation
On Error Resume Next

    If strTemp = vbYes Then
        Print #1, "strFileName " & .Name
        Print #1, "-----"
        Print #1, ""
    End If
    For intSlide = 1 To .Slides.Count
        If strTemp = vbYes Then Print #1, "Slide: " & intSlide
        strNotes = ActivePresentation.Slides(intSlide).NotesPage. _
        Shapes.Placeholders(2).TextFrame.TextRange.Text
        Print #1, ""
        Print #1, strNotes
        If strTemp = vbYes Then Print #1, "========"
    Next intSlide
End With
Close #1

有什么方法可以将格式和文本一起传输到word文档?

0 个答案:

没有答案