Private Sub Command1_Click()

On Error Resume Next
MSComm1.CommPort = 9
MSComm1.Settings = "9600,N,8,1"
MSComm1.Handshaking = comRTS
MSComm1.RTSEnable = True
MSComm1.DTREnable = True
MSComm1.RThreshold = 1
MSComm1.SThreshold = 1
MSComm1.InputMode = comInputModeText
MSComm1.InputLen = 0
MSComm1.PortOpen = True

MSComm1.Output = "AT" & vbCrLf
MSComm1.Output = "AT+CMGF=1" & vbCrLf
MSComm1.Output = "AT+CMGS=" '& Chr(34) & Trim(Text1.Text) & Chr(34) & vbCrLf
MSComm1.Output = Mid(Text2.Text, 1, 160) & Chr(26)
MSComm1.PortOpen = False
MsgBox "Successfully send Msg "


End Sub