Solved

Faxing application

Posted on 2004-04-23
7
239 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now