Operation Failed error using FAXCOMEXLib

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am currently in the process of building a vb.net windows application that
will be used to send faxes and monitor these faxes as they are sent. In the
project I am building the fax functionality into a single web form in order
to encapsulate this functionality. The error I am receiving has brought me to
the point of starting a brand new project with just the web-form for faxing.
I am using code provided by Microsoft
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxusing_27co.asp

This is throwing an error when it reaches the following line of code:
JobID = objFaxDocument.ConnectedSubmit(objFaxServer)

The error it is throwing is as follows:
exc.Message: 'Operation Failed'
exc.Source: 'FaxComEx.FaxDocument.1'

The entire code snippet that I am using in the form load is below:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'Declare fax variables...
Dim objFaxServer As New FAXCOMEXLib.FaxServer()
Dim objFaxDocument As New FAXCOMEXLib.FaxDocument()
Dim JobID As Object

Try

'Connect to the fax server...
objFaxServer.Connect("")

'Set the fax body
objFaxDocument.Body = "c:\fax.txt"

'Name the document
objFaxDocument.DocumentName = "My First Fax"

'Set the fax priority
objFaxDocument.Priority = FAX_PRIORITY_TYPE_ENUM.fptHIGH

'Add the recipient with the fax number 12225550100
objFaxDocument.Recipients.Add("555-5555", "Bud")

'Choose to attach the fax to the fax receipt
objFaxDocument.AttachFaxToReceipt = True

'Provide the cover page note
objFaxDocument.Note = "Here is the info you requested"

objFaxDocument.Subject = "Today's fax"

'Set the sender properties.
objFaxDocument.Sender.Title = "Mr."
objFaxDocument.Sender.Name = "Bob"
objFaxDocument.Sender.City = "Cleveland Heights"
objFaxDocument.Sender.State = "Ohio"
objFaxDocument.Sender.Company = "Microsoft"
objFaxDocument.Sender.Country = "USA"
objFaxDocument.Sender.Email = "(e-mail address removed)"
objFaxDocument.Sender.FaxNumber = "12165555554"
objFaxDocument.Sender.HomePhone = "12165555555"
objFaxDocument.Sender.OfficeLocation = "Downtown"
objFaxDocument.Sender.OfficePhone = "12165555553"
objFaxDocument.Sender.StreetAddress = "123 Main Street"
objFaxDocument.Sender.TSID = "Office fax machine"
objFaxDocument.Sender.ZipCode = "44118"
objFaxDocument.Sender.BillingCode = "23A54"
objFaxDocument.Sender.Department = "Accts Payable"

'Save sender information as default
objFaxDocument.Sender.SaveDefaultSender()

'Submit the document to the connected fax server
'and get back the job ID.
JobID = objFaxDocument.ConnectedSubmit(objFaxServer)

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

Catch exc As Exception

MsgBox("Exception message: " & exc.Message & vbCrLf & "Exception
Source: " & exc.Source)

End Try

End Sub
 
This problem has been resolved. After pounding my head against a wall for
about a day, it turns out that I needed to uninstall the MS Fax service and
then re-install it onto Windows Server 2003 Standard Edition.

I tested this by just trying to send out a fax through the fax console
manually. This failed and signified to me that somehow the MS Fax Service
installation became corrupted. Nothing changed on the fax server so this is
slightly worrying, but then again what fun would it be if it worked all the
time?
 
Back
Top