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

DocumentLibraryVersion.Comments Property (Office)

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

Gets any optional comments associated with the specified version of the shared document. Read-only.

Syntax

expression. Comments

expression A variable that represents a DocumentLibraryVersion object.

Remarks

A user can attach version comments through the document library user interface when checking in a document that was previously checked out.

Example

The following example lists comments and other properties for each version of a shared document.

 Dim dlvVersions As Office.DocumentLibraryVersions 
 Dim dlvVersion As Office.DocumentLibraryVersion 
 Dim strVersionInfo As String 
 Set dlvVersions = ActiveDocument.DocumentLibraryVersions 
 If dlvVersions.IsVersioningEnabled Then 
 strVersionInfo = "This document has " & _ 
 dlvVersions.Count & " versions: " & vbCrLf 
 For Each dlvVersion In dlvVersions 
 strVersionInfo = strVersionInfo & _ 
 " - Version #: " & dlvVersion.Index & vbCrLf & _ 
 " - Modified by: " & dlvVersion.ModifiedBy & vbCrLf & _ 
 " - Modified on: " & dlvVersion.Modified & vbCrLf & _ 
 " - Comments: " & dlvVersion.Comments & vbCrLf 
 Next 
 Else 
 strVersionInfo = "Versioning not enabled for this document." 
 End If 
 MsgBox strVersionInfo, vbInformation + vbOKOnly, "Version Information" 
 Set dlvVersion = Nothing 
 Set dlvVersions = Nothing

See also

Concepts

DocumentLibraryVersion Object

Other resources

DocumentLibraryVersion Object Members

© 2018 Microsoft