Share via


Comments.Add Method (Word)

Returns a Comment object that represents a comment added to a range.

Syntax

expression .Add(Range, Text)

expression Required. A variable that represents a Comments collection.

Parameters

Name

Required/Optional

Data Type

Description

Range

Required

Range object

The range to have a comment added to it.

Text

Optional

Variant

The text of the comment.

Return Value

Comment

Example

This example adds a comment at the insertion point.

Sub AddComment() 
 Selection.Collapse Direction:=wdCollapseEnd 
 ActiveDocument.Comments.Add _ 
 Range:=Selection.Range, Text:="review this" 
End Sub

This example adds a comment to the third paragraph in the active document.

Sub Comment3rd() 
 Dim myRange As Range 
 
 Set myRange = ActiveDocument.Paragraphs(3).Range 
 ActiveDocument.Comments.Add Range:=myRange, _ 
 Text:="original third paragraph" 
End Sub

See Also

Concepts

Comments Collection Object

Comments Object Members