Error number: 80070002, Operation failed.

  • Thread starter Thread starter futureofai
  • Start date Start date
F

futureofai

Hi I caught the error while running the following code in VB on my XP
home machine.

Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
Dim objFaxServer As New FAXCOMEXLib.FaxServer
Dim objSender As FaxSender
Dim JobID As Variant

On Error GoTo Error_Handler
objFaxServer.Connect ""
objFaxDocument.Body = "c:\Docs\Body.txt"
objFaxDocument.DocumentName = "My First Fax"
objFaxDocument.Priority = fptHIGH
objFaxDocument.Recipients.Add "09876672121", "Bud"
objFaxDocument.AttachFaxToReceipt = True
objFaxDocument.Note = "Here is the info you requested"
objFaxDocument.Subject = "Today's fax"
JobID = objFaxDocument.ConnectedSubmit(objFaxServer)
****ERROR IN THE ABOVE LINE***

MsgBox "The Job ID is :" & JobID(0)
Exit Sub

Error_Handler:
'Implement error handling at the end of your subroutine. This
implementation is for demonstration purposes
MsgBox "Error number: " & Hex(Err.Number) & ", " & Err.Description

Please help. Thanks
 
Sorry Guys..

I just found the mistake.

objFaxDocument.Body = "c:\Docs\Body.txt"

the file c:\Docs\Body.txt did not exist
 
Back
Top