Sdílet prostřednictvím


DocumentBase.Versions – vlastnost

Získá Versions kolekce, která představuje všechny verze dokumentu.

Obor názvů:  Microsoft.Office.Tools.Word
Sestavení:  Microsoft.Office.Tools.Word.v4.0.Utilities (v Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntaxe

'Deklarace
Public ReadOnly Property Versions As Versions
public Versions Versions { get; }

Hodnota vlastnosti

Typ: Microsoft.Office.Interop.Word.Versions
A Versions kolekce, která představuje všechny verze dokumentu.

Příklady

Následující příklad kódu používá Versions vlastnost, kterou chcete uložit novou verzi dokumentu a zobrazí informace o všech verzích dokumentu.Chcete-li tento příklad použít, spusťte jej ze třídy ThisDocument v projektu na úrovni dokumentu.

Private Sub DocumentVersions()
    Dim comment As Object = "My first save."
    Me.Versions.Save(comment)

    Dim version As Word.Version
    For Each version In Me.Versions
        MessageBox.Show("Version " & version.Index.ToString() & " saved by " _
            & version.SavedBy & " on " & version.Date)
    Next version
End Sub 
private void DocumentVersions()
{
    object comment = "My first save.";
    this.Versions.Save(ref comment);

    foreach (Word.Version version in this.Versions)
    {
        MessageBox.Show("Version " + version.Index.ToString() +
            " saved by " + version.SavedBy + " on " +
            version.Date);
    }
}

Zabezpečení rozhraní .NET Framework

Viz také

Referenční dokumentace

DocumentBase Třída

Microsoft.Office.Tools.Word – obor názvů