0

我完全是初学者,但我正在尝试在 VBA 中制作一个宏,以便在条件完成时使用 VoipBuster 平台发送短信。

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

请帮忙!

4

2 回答 2

1

对于从 voipbuster 发送短信,您可以通过 php vars 发送...
"https://www.voipbuster.com/myaccount/sendsms.php?username=$USER&password=$PASS&from=$FROM&to=\"$TO\"&text=$SMS_TEXT"

所以你需要像这样从vba访问iexplore,创建你的vars use,pass,text etcc和concat allthins,就像之前的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"
于 2013-03-28T11:03:28.467 回答
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
于 2013-03-28T11:39:16.743 回答