How to choose a specific modem when sending a fax?

505 views Asked by At

I'm writing an application to send faxes trought FAXCOMEXLib. I used this code:

Dim objFaxServer As New FAXCOMEXLib.FaxServer
Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
Dim JobID As Object

Try
    objFaxServer.Connect(txtFaxServer.Text)

    objFaxDocument.Body = Me.txtFile.Text
    objFaxDocument.DocumentName = "My First Fax"
    objFaxDocument.Recipients.Add(Me.txtNumber.Text, "")
    objFaxDocument.AttachFaxToReceipt = True
    objFaxDocument.Note = "Here is the info you requested"
    objFaxDocument.Subject = Me.txtFaxID.Text
    objFaxDocument.ReceiptAddress = "[email protected]"
    objFaxDocument.CoverPageType = FAXCOMEXLib.FAX_COVERPAGE_TYPE_ENUM.fcptNONE
    objFaxDocument.Priority = FAXCOMEXLib.FAX_PRIORITY_TYPE_ENUM.fptNORMAL
    objFaxDocument.ReceiptType = FAXCOMEXLib.FAX_RECEIPT_TYPE_ENUM.frtMAIL
    objFaxDocument.ScheduleType = FAXCOMEXLib.FAX_SCHEDULE_TYPE_ENUM.fstNOW

    JobID = objFaxDocument.ConnectedSubmit(objFaxServer)

    objFaxServer.Disconnect()

    'MessageBox.Show("The Job ID is :" & JobID(0), "Information")
Catch ex As Exception
    MessageBox.Show(ex.ToString, "Error")
End Try

I have two modems (Modem1 or Modem2). When using this code sending a fax is carried out by the first available modem.

But I need to send faxes using Modem1 or Modem2 under my rules. How can I select a specific modem to send a fax?

0

There are 0 answers