**************** 
    Private Sub Openport() 
    '³õ Ê¼ »¯ Modem 
    If Not MSComm1.PortOpen Then 
     MSComm1.CommPort = 3 
     MSComm1.RThreshold = 1 
     MSComm1.OutBufferSize = 1024 
     MSComm1.InBufferSize = 1024 
     MSComm1.Settings = "9600,n,8,1" 
     MSComm1.PortOpen = True 
    End If 
    End Sub 
     
     
    ******* 
    Private Function Waiting(strings As String, waittime As Integer) As String 
    '½Ó ÊÕ ModemµÄ ·µ »Ø ÐÅ Ï¢ 
    Dim Endtime As Long 
    Dim receivestring As String 
    Endtime = Timer + waittime 
    receivestring = "" 
    errorcode = 0 
    Do 
     DoEvents 
     If MSComm1.InBufferCount Then 
     receivestring = receivestring + MSComm1.Input 
     If InStr(1, receivestring, strings) Then 
     Exit Do 
     End If 
     End If 
     If Timer >= Endtime Or errorcode Then 
     errorcode = 1 
     Exit Do 
     End If 
    Loop 
    Waiting = receivestring 
    End Function 
     
    ********* 'ÅÐ ¶Ï ±¾ µØ Modem 
     Call Openport 
     MSComm1.Output = "AT" + Chr(13) 
     mywin = Waiting("OK", 5) 
     If errorcode Then 
     'ModemÎ´ ×¼ ±¸ ºÃ ,µç »° Õ¼ Ïß 
     Endif 
    ********* 
     'ÅÐ ¶Ï ¶Ô ·½ Modem 
     MSComm1.Output = "ATDT" + vbdialno + Chr(13) 
     wait = Waiting("CONNECT", 10) 
     If errorcode Then 
     '¶Ô ·½ ModemÎ´ ×¼ ±¸ ºÃ ,Õ¼ Ïß 
     Endif 
<END>