Error number: 80070002, Operation failed.

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
 
F

futureofai

Sorry Guys..

I just found the mistake.

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top