Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.