使用VBA通过VoipBuster发送短信

我是初学者,但是我正在尝试在VBA中使用VoipBuster平台发送短信,当条件完成时。

可能吗? 使用安装在PC或网页上的应用程序更容易吗( https://www.voipbuster.com/sms )。

请帮忙!

从voipbuster发送短信,你可以发送它的PHPvariables…
" https://www.voipbuster.com/myaccount/sendsms.php?username= $USER&password=$PASS&from=$FROM&to=\"$TO\"&text=$SMS_TEXT"

所以你需要像这样访问vba的iexplore,创build你的使用,传递,文本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" 

尝试下面的代码。 您也可以通过将URLvariables中的值添加到浏览器来进行testing。

 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 
Interesting Posts