Share via


Comments Interface

Represents a collection of Comment objects.

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
<GuidAttribute("914934D4-5A91-11CF-8700-00AA0060263B")> _
Public Interface Comments _
    Inherits Collection
'Usage
Dim instance As Comments
[GuidAttribute("914934D4-5A91-11CF-8700-00AA0060263B")]
public interface Comments : Collection

Examples

Use the Comments property 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 Add(Single, Single, String, String, String) method 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

Reference

Comments Members

Microsoft.Office.Interop.PowerPoint Namespace