我在 VBA Excel 中制作了一个用户表单,通过 Pushbullet 向我的客户发送短信,当我发送单行消息时它工作得很好,但是当我尝试发送多行消息时它不起作用,我在 stackoverflow 和谷歌中搜索没有答案,我需要一些帮助我正在使用的代码是:
Private Sub smsfac_Click()
Dim lastrow As Integer
'Activate "Microsoft XML, v6.0" under Tools > References
If Me.sms_client.value = "" Or Me.sms_nmbr.value = "" Or Me.sms_txt.value = "" Then
Me.smsfac.ForeColor = vbRed
Me.smsfac.BorderColor = vbRed
Application.Wait (Now + TimeValue("0:00:3"))
Me.smsfac.ForeColor = &HFFFF00
Me.smsfac.BorderColor = &H80000006
Else
Dim item As ListItem
Dim ACCESS_TOKEN As String
Dim TARGET_DEVICE_IDEN As String
'Authentication & Target Device ID
ACCESS_TOKEN = calcule.Range("C7").value
TARGET_DEVICE_IDEN = """" & calcule.Range("C8").value & """"
'Get last row number
'Clear Status
'Get receiver number & text message
receiver_number = """" & Me.sms_nmbr.Text & """"
text_message = """" & Me.sms_txt.Text & """"
'Use XML HTTP
Set Request = CreateObject("MSXML2.ServerXMLHTTP.6.0")
'Specify Target URL
URL = "https://api.pushbullet.com/v2/texts"
'Open Post Request
Request.Open "Post", URL, False
'Request Header
Request.setRequestHeader "Access-Token", ACCESS_TOKEN
Request.setRequestHeader "Content-Type", "application/json;charset=UTF-8"
'Concatenate PostData
postData = "{""data"":{""target_device_iden"":" & TARGET_DEVICE_IDEN & ",""addresses"":[" & receiver_number & "],""message"":" & text_message & "}}"
'Send the Post Data
Request.send postData
End If
End Sub
另外,如果没有发送短信的通知,这将对我有很大帮助,我感谢您的帮助