Comment Property

Microsoft Word Visual Basic

Comment Property

       

Returns the comment associated with the specified version of a document. Read-only String.

Example

This example displays the comment text for the first version of the active document.

If ActiveDocument.Versions.Count >= 1 Then
    MsgBox Prompt:=ActiveDocument.Versions(1).Comment, _
        Title:="First Version Comment"
End If

This example saves a version of the document with the user's comment and then displays the comment.

Dim verTemp As Versions
Dim strComment As String
Dim lngCount As Long

Set verTemp = ActiveDocument.Versions

strComment = InputBox("Type a comment")
verTemp.Save Comment:=strComment
lngCount = verTemp.Count
MsgBox Prompt:=verTemp(lngCount).Comment, _
    Title:=verTemp(lngCount).SavedBy