1

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 = "test@tin.it"
    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?

Larry
  • 2,764
  • 2
  • 25
  • 36
Ruslan Gilmutdinov
  • 1,217
  • 2
  • 9
  • 20
  • Is this not a library for using a fax server? If it is, I suspect you will have to configure the server for that, rather than modifying your code. – Brad Dec 27 '12 at 05:49
  • Is this documentation not helpful? http://msdn.microsoft.com/en-us/library/windows/desktop/ms693466(v=vs.85).aspx – ta.speot.is Dec 27 '12 at 05:53
  • I read that for configuring outgoing routing _fax device groups_ and _fax routing rules_ server settings can be used. But I wonder is there a way to specify modem to send a fax in code. – Ruslan Gilmutdinov Dec 27 '12 at 12:05

0 Answers0