Comments 集合

         
多个对象
Comments
Comment

代表 Comment 对象的集合。

使用 Comments 集合

使用 Comments 属性引用 Comments 集合。以下示例显示当前幻灯片上批注的编号。

Sub CountComments()
    MsgBox "You have " & ActiveWindow.Selection.SlideRange(1) _
        .Comments.Count & " comments on this slide."
End Sub

使用 Add 方法在幻灯片中添加一个批注。本示例在当前演示文稿的第一张幻灯片中添加一个新批注。

Sub AddComment()
    Dim sldNew As Slide
    Dim cmtNew As Comment

    Set sldNew = ActivePresentation.Slides.Add(Index:=1, _
        Layout:=ppLayoutBlank)
    Set cmtNew = sldNew.Comments.Add(Left:=12, Top:=12, _
        Author:="Jeff Smith", AuthorInitials:="JS", _
        Text:="You might consider reviewing the new specs " & _
        "for more up-to-date information.")
End Sub