Sync.LastSyncTime property (Office)

Gets the date and time when the local copy of the active document was last synchronized with the server copy. Read-only.

Note

Beginning with Microsoft Office 2010, this object or member has been deprecated and should not be used.

Syntax

expression.LastSyncTime

expression A variable that represents a Sync object.

Remarks

Use the LastSyncTime property to determine how much time has elapsed since the local copy of the active document was last synchronized with the server copy. Check the Status property to determine whether the local copy and the server copy are out of sync.

If the active document is not configured for synchronization between the local copy and the server copy, the LastSyncTime property raises a run-time error.

Example

The following example alerts the user and displays the sync status if more than 24 hours have elapsed since the LastSyncTime.

    Dim objSync As Office.Sync 
    Dim dtmLastSync As Date 
    Dim strStatus As String 
    Set objSync = ActiveDocument.Sync 
    dtmLastSync = CDate(objSync.LastSyncTime) 
    If DateDiff("h", dtmLastSync, Now) > 24 Then 
        strStatus = "Document has not been synced " & _ 
            " within the last 24 hours." & vbCrLf & _ 
            "Document status: " & objSync.Status 
        MsgBox strStatus, vbInformation + vbOKOnly, "Error Information" 
    End If 
    Set objSync = Nothing 

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.