Поделиться через


DocumentBase.DocumentLibraryVersions Property

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.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntax

'Declaration
Public ReadOnly Property DocumentLibraryVersions As DocumentLibraryVersions
    Get
public DocumentLibraryVersions DocumentLibraryVersions { get; }

Property Value

Type: Microsoft.Office.Core.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. To use this example, run it from the ThisDocument class in a document-level project.

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

DocumentBase Class

Microsoft.Office.Tools.Word Namespace