Sync Property

Microsoft PowerPoint Visual Basic

Show All Show All

Sync Property

Returns a Sync object that enables you to manage the synchronization of the local and server copies of a shared presentation stored in a Microsoft Windows SharePoint Services shared workspace. Read-only.

expression.Sync

expression    Required. An expression that returns a Presentation object.

Remarks

The Status property of the Sync object returns important information about the current state of synchronization. Use the GetUpdate method to refresh the sync status. Use the LastSyncTime, ErrorType, and WorkspaceLastChangedBy properties to return additional information.

For more information on the differences and conflicts that can exist between the local and server copies of shared presentations, see the Status property.

Use the PutUpdate method to save local changes to the server. Close and re-open the document to retrieve the latest version from the server when no local changes have been made. Use the ResolveConflict method to resolve differences between the local and the server copies, or the OpenVersion method to open a different version along with the currently open local version of the document.

The GetUpdate, PutUpdate, and ResolveConflict methods of the Sync object do not return status codes because they complete their tasks asynchronously. The Sync object provides important status information through a single event, called the PresentationSync event of the Application object.

The Sync event described above returns an msoSyncEventType value.

MsoSyncEventType can be one of the following msoSyncEventType constants.
msoSyncEventDownloadInitiated (0)
msoSyncEventDownloadSucceeded (1)
msoSyncEventDownloadFailed (2)
msoSyncEventUploadInitiated (3)
msoSyncEventUploadSucceeded (4)
msoSyncEventUploadFailed (5)
msoSyncEventDownloadNoChange (6)
msoSyncEventOffline (7)

The Sync object model is available whether sharing and synchronization are enabled or disabled on the active document. The Sync property of the Presentation object does not return Nothing when the active document is not shared or synchronization is not enabled. Use the Status property to determine whether the document is shared and whether synchronization is enabled.

Not all document synchronization problems raise run-time errors that can be trapped. After using the methods of the Sync object, it is a good idea to check the Status property. If the Status property is msoSyncStatusError, check the ErrorType property for additional information on the type of error that has occurred.

In many circumstances, the best way to resolve an error condition is to call the GetUpdate method. For example, if a call to PutUpdate results in an error condition, then a call to GetUpdate will reset the status to msoSyncStatusLocalChanges.

Example

The following example displays the name of the last person to modify the active presentation if the active presentation is a shared document in a Document Workspace.

    Dim eStatus As MsoSyncStatusType
Dim strLastUser As String

eStatus = ActivePresentation.Sync.Status

If eStatus = msoSyncStatusLatest Then
    strLastUser = ActivePresentation.Sync.WorkspaceLastChangedBy
    MsgBox "You have the most up-to-date copy." & _
        "This file was last modified by " & strLastUser
End If