FaxComExLib Com error

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have created a small test program for faxing.  On some machines it works and on others it throws the following COM error when trying to send the fax:
"System.Runtime.InteropServices.COMException (0x80070483): Operation failed. at FAXCOMEXLib.FaxDocumentClass.ConnectedSubmit(FaxServer pFaxServer)  at FaxTest.Form1.Button1_Click(Object sender, EventArgs e) in D:TestFaxTestForm1.vb:line 25"
Here is the source code from my test application.  All it requires is a reference to FaxComExLib.
<font color="#0000ff" size=2> Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
            Dim objFaxServer As New FAXCOMEXLib.FaxServer
            Dim obj() As Object
            Dim PriorityEnum As FAXCOMEXLib.FAX_PRIORITY_TYPE_ENUM</font>
<font color="#0000ff" size=2>            Specify FaxServer Name
            objFaxServer.Connect("jupiterp2003")</font>
<font color="#0000ff" size=2>            PriorityEnum = CType(1, FAXCOMEXLib.FAX_PRIORITY_TYPE_ENUM)
            objFaxDocument.Recipients.Add("555-5555", "taco")
            objFaxDocument.Sender.Company = "company"
            objFaxDocument.Priority = PriorityEnum
            objFaxDocument.Subject = "test subject"
            objFaxDocument.Note = "note"
            objFaxDocument.Sender.Name = "this guy"</font>
<font color="#0000ff" size=2>            Test Tiff to send
            objFaxDocument.Body = "c:FaxTestmerge.tif"</font>
<font color="#0000ff" size=2>           
            THROWS COM ERROR ON SOME MACHINES
            obj = DirectCast(objFaxDocument.ConnectedSubmit(objFaxServer), Object())
           
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub
End Class </font></font>
Anybody know what Im doing wrong or know how to fix the error?  Any help would be greatly appreciated.
Thanks.

View the full article
 
Back
Top