首页 > 解决方案 > 查看 PPT 评论

问题描述

我有一个包含 500 多张幻灯片的 PPT。它对我想获取/提取的几张幻灯片有评论。滚动所有 500 张幻灯片很困难。有没有办法,我可以一次获得所有评论?

预先感谢您的帮助!!

标签: powerpointpython-pptx

解决方案


你的标签提到了 python,但这感觉像是一个一次性的问题,因为你已经有了 PowerPoint,你可以使用 VBA 来解决它。像这样:

Sub ListComments()

Dim oSl As Slide
Dim oCom As Comment
Dim sTemp As String
Dim x As Long

For Each oSl In ActivePresentation.Slides
    For Each oCom In oSl.Comments
        sTemp = sTemp & oCom.Text & vbCrLf
        For x = 1 To oCom.Replies.Count
            sTemp = sTemp & vbTab & oCom.Replies(x).Text & vbCrLf
        Next
    Next
Next

' This will "print" the result to the immediate window
' Press Ctrl+G in the VBA editor if it's not open
' If there are more comments than the window will allow,
'   you'll need to write the contents of sTemp to file or
'   do something else with it.
Debug.Print sTemp

End Sub

推荐阅读