Private Sub Command1_Click() Dim obj As Object Dim ServerIp As String Dim ServerPort As String Dim UserID As String Dim Passwd As String Dim MobileNum As String Dim Message As String Dim ret_code As Long Dim ret_description As String Set obj = CreateObject("S2ACOM.S2Air") ServerIp = "203.66.172.131" ServerPort = "8000" UserID = "帳號" Passwd = "密碼" MobileNum = "接收簡訊的手機號碼" Message = "測試" ret_code = "0" ret_description = "HELLO" '建立連線 Call obj.StartCon(ServerIp, ServerPort, UserID, Passwd, ret_code) Debug.Print ret_code '傳送簡訊,如欲傳送多則,請多次呼叫SendMsg即可。 Call obj.SendMsg(MobileNum, Message, ret_code, ret_description) Debug.Print ret_code Debug.Print ret_description '結束連線 Call obj.EndCon End Sub