Public Sub OutputErrorCodes()
Dim intFileNo
Dim intErrorCode As Long
intFileNo = FreeFile
Open "C:\ErrorCodes.txt" For Output As intFileNo
For intErrorCode = 0 To 65535
Print #intFileNo, intErrorCode, Error(intErrorCode)
Next intErrorCode
Close #intFileNo
End Sub