Solved

Faxing application

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Vb.net 2008 2 56
Microsoft Access combo box help 2 38
SLMGR Switches Are Not Working On KMS Host 3 70
I need help embedding an image as HTML in my vb.net application 3 50
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

867 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

12 Experts available now in Live!

Get 1:1 Help Now