2013-03-28 143 views
0

我是初學者,但我試圖在條件完成時使用VoipBuster平臺在VBA中發送短信。使用VBA通過VoipBuster發送短信

可能嗎?使用安裝在PC或網頁上的應用程序更容易嗎(https://www.voipbuster.com/sms)。

請幫忙!

+0

與voipbuster.com只檢查其中他們給你的API調用從Excel發送短信的功能。 – 2013-03-28 10:40:09

+0

嗨桑托斯,在網絡上我看到,這是可能的,但我無法弄清楚究竟找... – maximladus 2013-03-28 10:49:31

回答

1

對於來自voipbuster發送短信,您可以通過PHP瓦爾發送...
" https://www.voipbuster.com/myaccount/sendsms.php?username= $USER&password=$PASS&from=$FROM&to=\"$TO\"&text=$SMS_TEXT"

所以,你需要從這樣的VBA訪問IEXPLORE,創建你乏使用,傳遞,文本ETCC和CONCAT everythins如URL之前..

從VBA調用IEXPLORE,你會發現有很多與谷歌的方式,在這裏你有一個例子

Private Sub IE_Autiomation() 
    Dim i As Long 
    Dim IE As Object 
    Dim objElement As Object 
    Dim objCollection As Object 

    ' Create InternetExplorer Object 
    Set IE = CreateObject("InternetExplorer.Application") 

    ' You can uncoment Next line To see form results 
    IE.Visible = False 

    ' Send the form data To URL As POST binary request 
    IE.Navigate "https://www.voipbuster.com/myaccount/sendsms.php?username=$USER&password=$PASS&from=$FROM&to=\"$TO\"&text=$SMS_TEXT" 
+0

如何與谷歌瀏覽 – Deb 2018-02-22 12:04:34

1

試試下面的代碼。您也可以通過將URL變量中的值添加到瀏覽器中進行測試。

Sub SendSms() 

    Dim username As String 
    Dim password As String 
    Dim sendTo As String 
    Dim msg As String 

    username = "test" 'enter username here 
    password = "test" 'enter password here 
    sendTo = "9999999999" 
    msg = "Hello" 

    Dim URL As String 
    URL = "https://www.voipbuster.com/myaccount/sendsms.php?username=" & username & "&password=" & password & "&to=" & sendTo & "&text=" & msg 

    Dim xml As Object 
    Set xml = CreateObject("MSXML2.XMLHTTP") 
    xml.Open "GET", URL, False 
    xml.send 
End Sub 
+0

桑托斯使用它,我得到這個錯誤:自動化錯誤(錯誤440)或系統錯誤:02146697202,有什麼不對?並突出顯示「xml.send」 – maximladus 2013-03-28 12:46:50

+0

https://www.voipbuster.com/myaccount/sendsms.php?username="test"&password="test"&to="9999999999"&text="Hello「請用正確的方式替換詳細信息並直接放入您的瀏覽器並讓我知道答案。 – 2013-03-28 12:48:32

+0

我無法訪問這個,因爲我在工作並限制訪問,我會在稍後讓你知道,謝謝!我可以問你是否在行「URL =」是否需要更換密碼=和其他與我用於登錄和短信的實際的? – maximladus 2013-03-28 12:51:59