CDOLive LLC The Premier Resource for Microsoft Collaboration Data Objects             

Error Codes

Because CDO 1.x and the CDO HTML Rendering library 1.x relies on MAPI all calls return a value which is zero if the call was successful or non-zero if an error, or warning, has occurred. A warning means the call was at least partially successful but may have produced an unexpected result or side effect. An error means the call was not successful.

For Microsoft Visual Basic programmers CDO 1.x define 32-bit type library constants for all relevant warning and error codes. They are returned as 32-bit values to Microsoft Visual Basic programs for both warnings and errors, but Microsoft Visual Basic treats the two cases differently. Errors are passed as 32-bit codes, while warnings are returned as the sum of decimal 1000 and the low-order word of the warning, even on a 32-bit platform.

To test for a warning in a Microsoft Visual Basic program, it is possible to use the decimal value from the following tables directly into the program. Alternatively, it is possible to compare the return value by subtracting the &H40000 bit and then adding 1000 decimal. This is equivalent to subtracting decimal 261144 from the constant.

The following code snippet shows how to check if a warning is returned:

If Err.Number = CdoW_PARTIAL_COMPLETION - 261144 Then
  MsgBox "An error has occurred. Description: " & Err.Description & " Number: " _
  & Err.Number
End If
CDO Error Codes in alphabetical Order
Constant Value Decimal
CdoE_ACCOUNT_DISABLED &H80040124 -2147746084
CdoE_AMBIGUOUS_RECIP &H80040700 -2147747584
CdoE_BAD_CHARWIDTH &H80040103 -2147746051
CdoE_BAD_COLUMN &H80040118 -2147746072
CdoE_BAD_VALUE &H80040301 -2147746561
CdoE_BUSY &H8004010B -2147746059
CdoE_CALL_FAILED &H80004005 -2147500037
CdoE_CANCEL &H80040501 -2147747073
CdoE_COLLISION &H80040604 -2147747332
CdoE_COMPUTED &H8004011A -2147746074
CdoE_CORRUPT_DATA &H8004011B -2147746075
CdoE_CORRUPT_STORE &H80040600 -2147747328
CdoE_DECLINE_COPY &H80040306 -2147746566
CdoE_DISK_ERROR &H80040116 -2147746070
CdoE_END_OF_SESSION &H80040200 -2147746304
CdoE_EXTENDED_ERROR &H80040119 -2147746073
CdoE_FAILONEPROVIDER &H8004011D -2147746077
CdoE_FOLDER_CYCLE &H8004060B -2147747339
CdoE_HAS_FOLDERS &H80040609 -2147747337
CdoE_HAS_MESSAGES &H8004060A -2147747338
CdoE_INTERFACE_NOT_SUPPORTED &H80004002 -2147500034
CdoE_INVALID_ACCESS_TIME &H80040123 -2147746083
CdoE_INVALID_BOOKMARK &H80040405 -2147746821
CdoE_INVALID_ENTRYID &H80040107 -2147746055
CdoE_INVALID_OBJECT &H80040108 -2147746056
CdoE_INVALID_PARAMETER &H80070057 -2147942487
CdoE_INVALID_TYPE &H80040302 -2147746562
CdoE_INVALID_WORKSTATION_ACCOUNT &H80040122 -2147746082
CdoE_LOGON_FAILED &H80040111 -2147746065
CdoE_MISSING_REQUIRED_COLUMN &H80040202 -2147746306
CdoE_NETWORK_ERROR &H80040115 -2147746069
CdoE_NO_ACCESS &H80070005 -2147942405
CdoE_NO_RECIPIENTS &H80040607 -2147747335
CdoE_NO_SUPPORT &H80040102 -2147746050
CdoE_NO_SUPPRESS &H80040602 -2147747330
CdoE_NON_STANDARD &H80040606 -2147747334
CdoE_NOT_ENOUGH_DISK &H8004010D -2147746061
CdoE_NOT_ENOUGH_MEMORY &H8007000E -2147942414
CdoE_NOT_ENOUGH_RESOURCES &H8004010E -2147746062
CdoE_NOT_FOUND &H8004010F -2147746063
CdoE_NOT_IN_QUEUE &H80040601 -2147747329
CdoE_NOT_INITIALIZED &H80040605 -2147747333
CdoE_NOT_ME &H80040502 -2147747074
CdoE_OBJECT_CHANGED &H80040109 -2147746057
CdoE_OBJECT_DELETED &H8004010A -2147746058
CdoE_PASSWORD_CHANGE_REQUIRED &H80040120 -2147746080
CdoE_PASSWORD_EXPIRED &H80040121 -2147746081
CdoE_SESSION_LIMIT &H80040112 -2147746066
CdoE_STRING_TOO_LONG &H80040105 -2147746053
CdoE_SUBMITTED &H80040608 -2147747336
CdoE_TABLE_EMPTY &H80040402 -2147746818
CdoE_TABLE_TOO_BIG &H80040403 -2147746819
CdoE_TIMEOUT &H80040401 -2147746817
CdoE_TOO_BIG &H80040305 -2147746565
CdoE_TOO_COMPLEX &H80040117 -2147746071
CdoE_TYPE_NO_SUPPORT &H80040303 -2147746563
CdoE_UNABLE_TO_ABORT &H80040114 -2147746068
CdoE_UNABLE_TO_COMPLETE &H80040400 -2147746816
CdoE_UNCONFIGURED &H8004011C -2147746076
CdoE_UNEXPECTED_ID &H80040307 -2147746567
CdoE_UNEXPECTED_TYPE &H80040304 -2147746564
CdoE_UNKNOWN_CPID &H8004011E -2147746078
CdoE_UNKNOWN_ENTRYID &H80040201 -2147746305
CdoE_UNKNOWN_FLAGS &H80040106 -2147746054
CdoE_UNKNOWN_LCID &H8004011F -2147746079
CdoE_USER_CANCEL &H80040113 -2147746067
CdoE_VERSION &H80040110 -2147746064
CdoE_WAIT &H80040500 -2147747072
CdoW_APPROX_COUNT &H00040482 -263298
CdoW_CANCEL_MESSAGE &H00040580 -263552
CdoW_ERRORS_RETURNED &H00040380 -263040
CdoW_NO_SERVICE &H00040203 -262659
CdoW_PARTIAL_COMPLETION &H00040680 -263808
CdoW_POSITION_CHANGED &H00040481 -263297

Because CDO 1.x relies on Extended MAPI it might be helpful to know the following MAPI error codes.

Error Codes defined by MAPI
Constant Value Decimal
MAPI_E_INTERFACE_NOT_SUPPORTED&H80004002 -2147467262
MAPI_E_CALL_FAILED&H80004005-2147467259
MAPI_E_NO_SUPPORT&H80040102-2147221246
MAPI_E_BAD_CHARWIDTH&H80040103-2147221245
MAPI_E_STRING_TOO_LONG&H80040105 -2147221243
MAPI_E_UNKNOWN_FLAGS&H80040106-2147221242
MAPI_E_INVALID_ENTRYID&H80040107 -2147221241
MAPI_E_INVALID_OBJECT&H80040108-2147221240
MAPI_E_OBJECT_CHANGED&H80040109-2147221239
MAPI_E_OBJECT_DELETED&H8004010a-2147221238
MAPI_E_BUSY&H8004010b-2147221237
MAPI_E_NOT_ENOUGH_DISK&H8004010d -2147221235
MAPI_E_NOT_ENOUGH_RESOURCES&H8004010e -2147221234
MAPI_E_NOT_FOUND&H8004010f-2147221233
MAPI_E_VERSION&H80040110-2147221232
MAPI_E_LOGON_FAILED&H80040111-2147221231
MAPI_E_SESSION_LIMIT&H80040112-2147221230
MAPI_E_USER_CANCEL&H80040113-2147221229
MAPI_E_UNABLE_TO_ABORT&H80040114 -2147221228
MAPI_E_NETWORK_ERROR&H80040115-2147221227
MAPI_E_DISK_ERROR&H80040116-2147221226
MAPI_E_TOO_COMPLEX&H80040117-2147221225
MAPI_E_BAD_COLUMN&H80040118-2147221224
MAPI_E_EXTENDED_ERROR&H80040119-2147221223
MAPI_E_COMPUTED&H8004011a-2147221222
MAPI_E_CORRUPT_DATA&H8004011b-2147221221
MAPI_E_UNCONFIGURED&H8004011c-2147221220
MAPI_E_FAILONEPROVIDER&H8004011d -2147221219
MAPI_E_UNKNOWN_CPID&H8004011e-2147221218
MAPI_E_UNKNOWN_LCID&H8004011f-2147221217
MAPI_E_PASSWORD_CHANGE_REQUIRED&H80040120 -2147221216
MAPI_E_PASSWORD_EXPIRED&H80040121 -2147221215
MAPI_E_INVALID_WORKSTATION_ACCOUNT&H80040122 -2147221214
MAPI_E_INVALID_ACCESS_TIME&H80040123 -2147221213
MAPI_E_ACCOUNT_DISABLED&H80040124 -2147221212
MAPI_E_END_OF_SESSION&H80040200-2147220992
MAPI_E_UNKNOWN_ENTRYID&H80040201 -2147220991
MAPI_E_MISSING_REQUIRED_COLUMN&H80040202 -2147220990
MAPI_E_BAD_VALUE&H80040301-2147220735
MAPI_E_INVALID_TYPE&H80040302-2147220734
MAPI_E_TYPE_NO_SUPPORT&H80040303 -2147220733
MAPI_E_UNEXPECTED_TYPE&H80040304 -2147220732
MAPI_E_TOO_BIG&H80040305-2147220731
MAPI_E_DECLINE_COPY&H80040306-2147220730
MAPI_E_UNEXPECTED_ID&H80040307-2147220729
MAPI_E_UNABLE_TO_COMPLETE&H80040400 -2147220480
MAPI_E_TIMEOUT&H80040401-2147220479
MAPI_E_TABLE_EMPTY&H80040402-2147220478
MAPI_E_TABLE_TOO_BIG&H80040403-2147220477
MAPI_E_INVALID_BOOKMARK&H80040405 -2147220475
MAPI_E_WAIT&H80040500-2147220224
MAPI_E_CANCEL&H80040501-2147220223
MAPI_E_NOT_ME&H80040502-2147220222
MAPI_E_CORRUPT_STORE&H80040600-2147219968
MAPI_E_NOT_IN_QUEUE&H80040601-2147219967
MAPI_E_NO_SUPPRESS&H80040602-2147219966
MAPI_E_COLLISION&H80040604-2147219964
MAPI_E_NOT_INITIALIZED&H80040605 -2147219963
MAPI_E_NON_STANDARD&H80040606-2147219962
MAPI_E_NO_RECIPIENTS&H80040607-2147219961
MAPI_E_SUBMITTED&H80040608-2147219960
MAPI_E_HAS_FOLDERS&H80040609-2147219959
MAPI_E_HAS_MESSAGES&H8004060a-2147219958
MAPI_E_FOLDER_CYCLE&H8004060b-2147219957
MAPI_E_AMBIGUOUS_RECIP&H80040700 -2147219712
MAPI_E_INVALID_PARAMETER&H80070057 -2147024809
MAPI_E_NOT_ENOUGH_MEMORY&H8007000e -2147024882
MAPI_E_NO_ACCESS&H80070005-2147024891

Note that the Microsoft Visual Basic Scripting Edition and Microsoft JScript do not support any predefined constants. If your application is running as server-side script (e. g. a Microsoft Active Server Pages application or a Microsoft Exchange Scripting & Routing script) or client-side script (e. g. in a Microsoft Outlook form), you must use the appropriate hexadecimal or decimal values instead of the type library constants.

The information on this page is compiled together from the Microsoft Developer Network (MSDN). For the most current list of error and warning codes please take a look at the Microsoft Developer Network (see Links @ Microsoft).