Solved

Faxing application

Posted on 2004-04-23
7
248 Views
Last Modified: 2008-03-04
Can somebody give me code example on how to create a faxing application.
such as : fax wizard that appear on the windows????
0
Comment
Question by:rickson
  • 3
7 Comments
 
LVL 5

Accepted Solution

by:
amit1978 earned 125 total points
ID: 10897995
This is sending fax manualy with the help of MSComm control and telephone line connected to your phone :

Hope this will solve ur problem.

Amit Jain
~~~~~~~~~~~~~~~~~~~~~~~
Private Sub Faxsend() **name of function
Dim i As Integer
Dim a As Byte
Dim pfad As String
Dim dialstring As String
'setting the mscommm port setttings.
MSComm1.CommPort = 1
MSComm1.PortOpen = True
If Err Then
  MsgBox "COM Port not available"
  Exit Sub
End If
'setting the baud rates.
MSComm1.Settings = "19200,N,8,1"
MSComm1.InputLen = 0
MSComm1.InBufferCount = 0
'variuos AT modem commands are used to send to the modem
'modem reset
MSComm1.Output = "ATZ" + vbCr
If wait("OK") = False Then Exit Sub

'setting the fax class=2.0
MSComm1.Output = "AT+FCLASS=2.0" + vbCr
If wait("OK") = False Then Exit Sub

'local id .
MSComm1.Output = "AT+FLI=" + Chr$(34) + "303" + Chr$(34) + vbCr
If wait("OK") = False Then Exit Sub

'command for Intitialize the fax parameters
MSComm1.Output = "AT+FIP" + vbCr
If wait("OK") = False Then Exit Sub

'entering the number fomr the user
Number = InputBox("Enter phone number:", "05524772")

'dialing the number using ATDT command
dialstring = "ATDT" + Number + ";" + Chr$(13)

MSComm1.Output = dialstring
If wait("OK") = False Then Exit Sub

'controls the mode that modem will act as datamodem.
MSComm1.Output = "AT+FAA=1" + vbCr
If wait("OK") = False Then Exit Sub


'MSComm1.Output = "AT+FDM" + vbCr
'If wait("OK") = False Then Exit Sub

'FLO command selects the method of flow control XON/XOFF=1
MSComm1.Output = "AT+FLO=1" + vbCr
If wait("OK") = False Then Exit Sub

''document to poll
'MSComm1.Output = "AT+FTP=1" + vbCr
'If wait("OK") = False Then Exit Sub
MSComm1.Output = "AT+FCO" + vbCr
If wait("OK") = False Then Exit Sub

'command for data transfer from modem ...
MSComm1.Output = "AT+FDT"    'init fax data sending
If wait("Connect") = False Then Exit Sub

i = FreeFile
Open "c:\windows\desktop\myfax\fax.txt" For Binary Access Read As #i
Do While Not (UCase(Right$(pfad, 4) = ".txt"))
  Get #1, , a               'skip header line
  pfad = pfad + Chr$(a)
Loop
Do While Not (EOF(i))
  Get #i, , a               'get byte from fax file
  If MSComm1.InBufferCount > 0 Then
    If MSComm1.Input = Chr$(24) Then    'wait for OK if cancel from modem
      If wait("OK") = False Then Exit Sub
    End If
  End If
  MSComm1.Output = Chr$(a)      'send byte to modem
Loop
     'Dim FileName
        'FileName = CommonDialog1.FileName
     'If FileName <> "" Then
      '   Open FileName For Binary Access Read Lock Read As #1
         'Open FileName For Random As #1

'         Dim tmpbuffer As Variant
 '        tmpbuffer = Input(LOF(1), 1)
   'MSComm1.OutBufferSize = Len(tmpbuffer)
    'MSComm1.Output = tmpbuffer

MSComm1.Output = Chr$(16) + Chr$(3) 'terminate sending fax data
If wait("OK") = False Then Exit Sub
MSComm1.Output = "AT+FET=2" + vbCr
If wait("OK") = False Then Exit Sub
MSComm1.PortOpen = False    '    ,close line
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~`
0
 
LVL 4

Author Comment

by:rickson
ID: 10938755
thanks, will try it out. give me couple of days.....
regards,
ed
0
 
LVL 4

Author Comment

by:rickson
ID: 11074736
thank for the source, but can u give me details about all the FAX command???? is ot all the same???
eg:
'setting the fax class=2.0
MSComm1.Output = "AT+FCLASS=2.0" + vbCr




0
 
LVL 4

Author Comment

by:rickson
ID: 11257765
i think split the points can be fair enough. the problem is, I can't see any function on the page that allow me to split points.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question