473,406 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Fax via modem

48
Dear friends,

I’m doing an assignment that need to fax a document. I a newbie and know some basic coding. After did tons of research, I able to write something at last. But there are some problems, the coding below not allow me to fax. Can anyone help me to check my code?

‘Setting mscomm and dial
Private Sub cmdDial_Click()

Dim results As String
Dim num_tries As Long

DoEvents
On Error GoTo Oops <----------my friend suggested me to add in, whats for?

' Try to give MSComm1 time to close.
If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
DoEvents

' Set the comm port number, actually I can assume it is always Port 1
MSComm1.CommPort = CInt(cboCommPort.Text)

' Read the entire buffer when Input is used.
MSComm1.InputLen = 0

' 9600 baud, no parity, 8 data bits, 1 stop bit. Is it a default setting?
MSComm1.Settings = "9600,N,8,1"

' Open the comm port.
MSComm1.PortOpen = True

' Dial the phone number.
MSComm1.Output = "ATDT " & CleanPhoneNumber(txtPhoneNumber.Text) & vbCr

' Ask the user to wait until the phone rings.
MsgBox "Connecting…", vbOKOnly, "Please Wait"

‘Print document, If I choose a printing device as a modem, it might able to print by fax machine.
Print form

' Close the serial port.
MSComm1.PortOpen = False
Exit Sub


Appreciate to any reply.Thank you.
Dec 21 '06 #1
1 2697
kuzure
48
Dear friends,

Sorry, I had miss post something, and cannot be edited, so I post this again, this is my coding, which might wrong.

I’m doing an assignment that need to fax a document. I a newbie and know some basic coding. After did tons of research, I found out a way to fax. But there is some problem, the coding below not allow me to fax. Can anyone help me to check my code?

‘Setting mscomm and dial
Private Sub cmdDial_Click()

Open “C:\VB6\testing.doc” For Input As #1

DoEvents
On Error GoTo Oops

' Try to give MSComm1 time to close.
If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
DoEvents

' Set the comm port number.
MSComm1.CommPort = CInt(cboCommPort.Text)

' Read the entire buffer when Input is used.
MSComm1.InputLen = 0

' 9600 baud, no parity, 8 data bits, 1 stop bit.
MSComm1.Settings = "9600,N,8,1"

' Open the comm port.
MSComm1.PortOpen = True

' Dial the phone number.
MSComm1.Output = "ATDT " & CleanPhoneNumber(txtPhoneNumber.Text) & vbCr

' Ask the user to wait until the phone rings.
MsgBox "Connecting…", vbOKOnly, "Please Wait"

‘Print document
Print form

' Close the serial port.
MSComm1.PortOpen = False
Exit Sub

Appreciate to any reply. Thank you.
Dec 21 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Kees Bakelaar | last post by:
Hi all, This is not really a VB question, however, i am stuck a modem problem The modem is connected to a cristie teleport with a speed of 9600 bps. How can i set the modems DTE speed at...
1
by: Ashish | last post by:
I wanted to make a Java application which would dial a telephone number using the modem. When the person on the other end lifts up the telephone (answers the phone), the application should start...
1
by: Ashish | last post by:
Hi, I was trying to make a out going call through the voice modem, play a audio file and disconnect. With the XTAPI implementation of the JTAPI I am able to do it with an analog phone line. The...
2
by: Etienne Labuschagne | last post by:
Assuming the modem is on COM5: m = open('COM5','wb+') m.write('+++\r\n') m.flush() m.write('ATQ0V1E0\r\n') m.flush() m.write('ATDT5551234;\r\n') m.flush() response = m.read()
5
by: Cc | last post by:
hi, I making a program to control modem , I had follow example from MS website on how to access serial port but still don't know how to make modem dial . Is there any example on how I could make...
17
by: Franc Zabkar | last post by:
My D-Link DSL-302G modem/router has a real-time clock whose settings are volatile. To avoid hand keying the date/time via the modem's JS interface, I wonder if there is a way to copy the JS code to...
0
by: bishnu12 | last post by:
Hi all, There are two questions 1. I am trying to write a programme which can query to a modem get the modem details. i am using normal send() and recv() functions. But when i try to fetch a...
3
by: Nutshell | last post by:
Hello everybody, in my application I'd need to know if a com port is a modem or not (and eventually its description and if it is a null modem). I get the list of com ports available with: string...
2
by: muruganyuva | last post by:
hi, in my project i'm sending the data from source to destination with the help of modem. one modem at the source and other at the destination. at first i'm initializing the source modem. ...
0
by: coaxfiber | last post by:
Hello, I have problem using dial-up connection with Fedora. My modem is not detected by the system.I have tried to install some drivers (*.tar) but didn't work.I'm not sure if this modem is not...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.