ErrorType Property

Microsoft Office Visual Basic

Show All Show All

ErrorType Property

Returns a constant which indicates the type of the most recent document synchronization error. Read-only MsoSyncErrorType.

MsoSyncErrorType can be one of the following msoSyncErrorType constants.
msoSyncErrorNone (0)
msoSyncErrorUnauthorizedUser (1)
msoSyncErrorCouldNotConnect (2)
msoSyncErrorOutOfSpace (3)
msoSyncErrorFileNotFound (4)
msoSyncErrorFileTooLarge (5)
msoSyncErrorFileInUse (6)
msoSyncErrorVirusUpload (7)
msoSyncErrorVirusDownload (8)
msoSyncErrorUnknownUpload (9)
msoSyncErrorUnknownDownload (10)
msoSyncErrorCouldNotOpen (11)
msoSyncErrorCouldNotUpdate (12)
msoSyncErrorCouldNotCompare (13)
msoSyncErrorCouldNotResolve (14)
msoSyncErrorNoNetwork (15)
msoSyncErrorUnknown (16)

expression.ErrorType()

expression    Required. An expression that returns a Sync object.

Remarks

Use the ErrorType property to determine the type of the most recent document synchronization error.

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 checks the Status property, then uses the ErrorType property to display the type of sync error that has occurred.

        Dim objSync As Office.Sync
    Dim strError As String
    Set objSync = ActiveDocument.Sync
    If objSync.Status = msoSyncStatusError Then
        strError = "A sync error has occurred." & vbCrLf & _
            "Error type: " & objSync.ErrorType
    Else
        strError = "No sync error has occurred."
    End If
    MsgBox strError, vbInformation + vbOKOnly, "Error Information"
    Set objSync = Nothing