Table of contents
TOC
Collapse the table of content
Expand the table of content

Comments Object (PowerPoint)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Represents a collection of Comment objects.

Example

Use the Commentsproperty to refer to the Comments collection. The following example displays the number of comments on the current slide.

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

Use the Addmethod to add a comment to a slide. This example adds a new comment to the first slide of the active presentation.

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

See also

Concepts

PowerPoint Object Model Reference

© 2017 Microsoft