Document.DocumentLibraryVersions Property (2007 System)

Gets a DocumentLibraryVersions collection that represents the collection of versions of a shared document that has versioning enabled and that is stored in a document library on a server.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property DocumentLibraryVersions As DocumentLibraryVersions
'Usage
Dim instance As Document 
Dim value As DocumentLibraryVersions 

value = instance.DocumentLibraryVersions
[BrowsableAttribute(false)]
public DocumentLibraryVersions DocumentLibraryVersions { get; }
[BrowsableAttribute(false)]
public:
property DocumentLibraryVersions^ DocumentLibraryVersions {
    DocumentLibraryVersions^ get ();
}
public function get DocumentLibraryVersions () : DocumentLibraryVersions

Property Value

Type: DocumentLibraryVersions
A DocumentLibraryVersions collection.

Examples

The following code example displays a message that shows the total number of document versions if versioning is enabled in the document.

This example is for a document-level customization.

Private Sub DocumentDocumentLibraryVersions()
    Dim dlvVersions As Office.DocumentLibraryVersions = Me.DocumentLibraryVersions
    Dim strVersionInfo As String 
    If dlvVersions.IsVersioningEnabled = True Then
        strVersionInfo = "This docment has " & dlvVersions.Count & " versions" 
    Else
        strVersionInfo = "Versioning is not enabled for this document." 
    End If

    MessageBox.Show(strVersionInfo, "Version Information", MessageBoxButtons.OK)
End Sub
private void DocumentDocumentLibraryVersions()
{
    Office.DocumentLibraryVersions dlvVersions = this.DocumentLibraryVersions;
    string strVersionInfo;
    if (dlvVersions.IsVersioningEnabled == true)
    {
        strVersionInfo = "This docment has " + dlvVersions.Count +
            " versions";
    }
    else
    {
        strVersionInfo = "Versioning is not enabled for this document.";
    }

    MessageBox.Show(strVersionInfo, "Version Information", MessageBoxButtons.OK);
}

.NET Framework Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace