Partager via


WorkbookBase.Sync Property

Gets a Microsoft.Office.Core.Sync object that provides access to the methods and properties of documents that are part of a Document Workspace.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

Syntax

'Declaration
Public ReadOnly Property Sync As Sync
public Sync Sync { get; }

Property Value

Type: Microsoft.Office.Core.Sync
A Microsoft.Office.Core.Sync object that provides access to the methods and properties of documents that are part of a Document Workspace.

Examples

The following code example uses the SharedWorkspace property to determine whether the current workbook is part of a Document Workspace. If the workbook is part of a Document Workspace, then the example uses the Sync property to display the user who last changed the document.

This example is for a document-level customization.

Private Sub DisplayLastChangeBy()
    If Me.SharedWorkspace.Connected Then
        MsgBox("Last changed by: " & _
            Me.Sync.WorkspaceLastChangedBy)
    Else
        MsgBox("The current document is not connected " & _
            "to a shared workspace.")
    End If 
End Sub
private void DisplayLastChangeBy()
{
    if (this.SharedWorkspace.Connected)
    {
        MessageBox.Show("Last changed by: " +
            this.Sync.WorkspaceLastChangedBy);
    }
    else
    {
        MessageBox.Show("The current document is not connected " +
            "to a shared workspace.");
    }
}

.NET Framework Security

See Also

Reference

WorkbookBase Class

Microsoft.Office.Tools.Excel Namespace