OpenVersion Method

Microsoft Office Visual Basic

Not all document synchronization problems raise trappable run-time errors. After performing an operation using 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.

Example

The following example prompts the user to open the server copy of the shared document alongside the currently open local version.

    Dim objSync As Office.Sync
    Dim lngChoice As VbMsgBoxResult
    Set objSync = ActiveDocument.Sync
    lngChoice = MsgBox("View server copy?", _
        vbQuestion + vbOKCancel, "Open Server Version?")
    If lngChoice = vbOK Then
        objSync.OpenVersion msoSyncVersionServer
    End If
    Set objSync = Nothing