Skip to content

Latest commit

 

History

History
63 lines (39 loc) · 1.25 KB

Word.Version.Comment.md

File metadata and controls

63 lines (39 loc) · 1.25 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Version.Comment property (Word)
vbawd10.chm162792428
vbawd10.chm162792428
Word.Version.Comment
52ca9077-0295-3059-b699-6fa97ad45991
06/08/2017
medium

Version.Comment property (Word)

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

Syntax

expression.Comment

expression A variable that represents a 'Version' object.

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

See also

Version Object

[!includeSupport and feedback]