Private Sub Command2_Click()
Dim PhoneNumber
Dim x As Long
Dim p As Integer

PhoneNumber = Text1

'Open up a com port to dial using the modem
MSComm1.PortOpen = True

'Dial the number you entered in the text box
MSComm1.Output = "ATDT" & PhoneNumber & Chr$(13)

'wait a few seconds before you pick up the phone
'giving time to dial the number
For x = 1 To 30000
        p = DoEvents()
    Next x
   
'The number has been dialed you can now pick up the phone
MsgBox "You may now pick up the phone"

'Now close the port so you can talk on the phone
MSComm1.PortOpen = False
End Sub