How to find the status of fax operation using FAXCOM.dll

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bharathreddy
    New Member
    • Aug 2006
    • 116

    #1

    How to find the status of fax operation using FAXCOM.dll

    This article will explain you how to find the status of the fax operation. (Using FAXCOM.dll). Author: Bharath Reddy VasiReddy

    Reference to the FAXCOM.DLL

    Reference to
    [code=vbnet]
    import FAXCOM
    import FAXCOMLib
    [/code]
    Tracking The Status of Faxes:

    After sending the fax, we need to confirm whether the fax has been sent or not. For this, we need to employ tracking for the status of faxes. In this, if the file gets transmitted in its first attempt of dialing the Faxmodem, the status of the fax Queue will be changed; otherwise it will try two more times (the exact no. of times can be modified programmaticall y). For this we have to create FaxJob object, which permits a fax client Visual Basic application to access the job status for incoming and outgoing fax transmissions, and to pause, resume, cancel or restart a fax job.

    We can also use the object to retrieve information about fax jobs. The information includes, among other items, the fax number to which the fax server will send the transmission, job attributes, and recipient and sender information. There is one FaxJob object for each queued job associated with the server.

    Prior to that, we have to call the GetJobs method of the FaxServer object to create a FaxJobs object on the connected fax server. Using the SetStatus method of Fax Status object, we can change the job status of a specified FaxJob object. We can use this method to pause, resume, cancel, or restart a specified fax job.
    [code=vbnet]
    Dim FJ As New FaxJobs
    'to access the job status for incoming
    'and outgoing fax transmissions
    Dim intCount As Integer
    Dim FJ1 As New FaxJob
    Set FJ = FS.GetJobs
    intCount = FJ.Count
    For i = 1 To intCount
    Set FJ1 = FJ.Item(i)
    MsgBox "JobId=" & FJ1.JobId
    MsgBox "QueueStatu s " + FJ1.QueueStatus
    Next I
    Dim FJ As New FaxJobs
    'to access the job status for incoming
    'and outgoing fax transmissions
    Dim intCount As Integer
    Dim FJ1 As New FaxJob
    Set FJ = FS.GetJobs
    intCount = FJ.Count
    For i = 1 To intCount
    Set FJ1 = FJ.Item(i)
    MsgBox "JobId=" & FJ1.JobId
    MsgBox "QueueStatu s " + FJ1.QueueStatus
    Next I

    [/code]


    Monitoring Port Status:
    The Fax Status allows our application to keep track of each stage of a fax’s sending or receiving progress. Using Get Status method of the FaxPort object, we can create Fax Status object. The FaxStatus object permits a fax client Visual Basic application to retrieve status information for a specific port on a connected fax server.

    Before that, we have to create FaxPorts object by calling the GetPorts method of the FaxServer object. Using the Receive property of Fax Status object, we can find whether the specified fax port is currently receiving a fax transmission or not. If this property is a nonzero value, the port is currently receiving a fax.

    The Send property of FaxStatus object tells us whether the specified fax port is currently sending a fax transmission. If this property is a nonzero value, the port is currently sending a fax.

    The sample code for monitoring Fax status as follows:
    [code=vbnet]
    Dim FS As New FaxServer
    Dim FST As New FaxStatus
    Dim FP As New FaxPort
    Dim lReceive As Long
    Dim lSend As Long
    Set FP = FS.GetPorts
    Set FST = FP.Item(1)
    lReceive = FP1.Receive
    If lReceive Then
    MsgBox "port is enabled to receive faxes"
    Else
    MsgBox "port is not enabled to receive faxes"
    End If
    lSend = FP1.Send
    If lSend Then
    MsgBox "port is enabled to Send faxes"
    Else
    MsgBox "port is not enabled to Send faxes"
    End If
    Dim FS As New FaxServer
    Dim FST As New FaxStatus
    Dim FP As New FaxPort
    Dim lReceive As Long
    Dim lSend As Long
    Set FP = FS.GetPorts
    Set FST = FP.Item(1)
    lReceive = FP1.Receive
    If lReceive Then
    MsgBox "port is enabled to receive faxes"
    Else
    MsgBox "port is not enabled to receive faxes"
    End If
    lSend = FP1.Send
    If lSend Then
    MsgBox "port is enabled to Send faxes"
    Else
    MsgBox "port is not enabled to Send faxes"
    End If

    [/code]
    Thanks & Regs
    Bharath Reddy VasiReddy
    eXensys
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Bharath, thank you for providing such an insight on how to use faxes in .NET!
    I'm sure this will be very useful for many people!

    -Frinny

    Comment

    • mushtaq22
      New Member
      • Jan 2008
      • 1

      #3
      Hi

      Can you tell me how can i find the port in which fax modem is connected. when i am accessing through network.

      I mean to say i need to send a fax which is connected to some other machine.

      Pls help

      Comment

      • HamzaFassi
        New Member
        • Sep 2010
        • 8

        #4
        Hi, I was wondering if it's possible to connect many fax modems to a single PC.. then to create multiple objects for every fax modem then send the next fax with the next available faxmodem.. is it possible? any suggestion?

        please help

        Comment

        Working...