devxlogo

Phone dialer

Phone dialer

Question:
Is it possible to connect and disconnect a Microsoft phone dialer that calls my Internetservice provider from a VB program?

Answer:
It sure is, and VB makes it very easy. The Microsoft Comm Control (MSCOMM32.OCX) that ships with the Enterprise edition of VB allows you to interact with serial ports on your computer. To dial a phone number follow these steps:

1. Add the MSCOMM control to the Toolbox and then place it on a form.
2. Set the CommPort property to the number of the port the modem is connected to. Try 2MSComm1.CommPort=2
3. Set the Settings property to specify the Baud rate, parity, data bits, and stop bit. You can usually leave this property at its default value which is:

MSComm1.Settings = “9600,N,8,1”

4. Open the communications port:

MSComm1.PortOpen = True

5. Dial the number using a string made up of the Hayes-compatible command set (AT starts the connection, D dials, T specifies Touch Tone):

MSComm1.Output =”ATDT” & Number$ & vbCr

6. To disconect the modem:

MSComm1.Output = “ATH” + vbCr

devx-admin

Share the Post: