This documentation is archived and is not being maintained.

Sync Interface

Use the Sync object to manage the synchronization of the local and server copies of a shared document stored in a Windows SharePoint Services document workspace.

Namespace:  Microsoft.Office.Core
Assembly:  office (in office.dll)

[GuidAttribute("000C0386-0000-0000-C000-000000000046")]
public interface Sync : _IMsoDispObj

The Sync property of the Microsoft Office Word 2003 Document object, the Microsoft Office Excel 2003 Workbook object, and the Microsoft Office PowerPoint 2003 Presentation object returns a Sync object.

The Status property 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.

See the Status property for additional information on the differences and conflicts that can exist between the local and server copies of shared documents.

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 alongside 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, which the developer can access through the following application-specific events:

  • In Word, through the Sync event of the Document object or the DocumentSync event of the Application object.

  • In Excel, through the Sync event of the Workbook object or the WorkbookSync event of the Application object.

  • In PowerPoint, through the PresentationSync event of the Application object.

The Sync event described above returns an MsoSyncEventType value.

The Sync object model is available whether sharing and synchronization are enabled or disabled on the active document. The Sync property of the Document, Workbook, and Presentation objects 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 trappable run-time errors. After using the methods of the Sync object, it's 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.

Show: