Dials a telephone number w/o using APIs

By | 2002-06-01

Uses the MSComm control to call a telephone number using your modem WITHOUT HAVEING DIALER.EXE! 🙂

Original Author: alex

Inputs

num – the telephone number

Assumptions

Assumes you have a MSComm control on your form named “Communications”

Code

Private Sub Dial(num As String)
' Open the com port.
Communications.PortOpen = True
' Send the attention command to the modem.
Communications.Output = "AT" + Chr$(13)
' Wait for processing.
Do
  DoEvents
  Loop Until Communications.InBufferCount >= 2
  ' Dial the number.
  Communications.Output = "ATDT " + num + Chr$(13)
  ' Takes about 47 sec. to dial
  wait = Timer + 47
  Do
   DoEvents
   Loop While Timer <= wait
   ' Uncomment to disconnect after dialing.
   'Communications.PortOpen = False
  End Sub

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.