Hey CK,
Thank you for your reply:
Did you mean this?
Public Function encodeURL(ByVal queryPart As String)
Dim c As String
While Len(queryPart) > 0
c = Left(queryPart, 1)
queryPart = Mid(queryPart, 2, Len(queryPart) - 1)
If c Like "[A-Za-z0-9._~-]" Then
encodeURL = encodeURL & c
ElseIf c = " " Then
encodeURL = encodeURL & "+"
Else
encodeURL = encodeURL & "%" & Right("0" & Hex(Asc(c)), 2)
End If
Wend
End Function
Sub Sample()
Const sUser As String = "***"
Const sPw As String = "**"
Const sId As String = "**"
Const baseUrl As String = "****"
Dim sReq As String, myMsg As String, dest As String
Dim resp As String
With Sheets("INVOICE")
myMsg = "Keep the kids happy this summer with free entry to the " & .Range("C3").Text & " Paintball Centre through out the season. Call " & .Range("AA2").Text & "."
End With
myMsg = encodeURL(myMsg)
dest = "***"
sReq = "?mobile=" & sUser & "&pass=" & sPw & "&senderid=" & sId & "&to=" & dest & "&msg=" & myMsg
With CreateObject("MSXML2.xmlHttp") 'May need to change this to MSXML2.ServerXMLHTTP
.Open "POST", baseUrl & sReq, False
.setRequestHeader "Content-type", "application/x-www-form-urlencoded" 'You will need to find from vendor what headers are needed
.Send
resp = .responseText
On Error GoTo ErrHandle:
Sub Sample()
Const sUser As String = "***"
Const sPw As String = "****"
Const sId As String = "**"
Const baseUrl As String = "***"
Dim sReq As String, myMsg As String, dest As String
Dim resp As String
With Sheets("INVOICE")
myMsg = "Keep the kids happy this summer with free entry to the " & .Range("C3").Text & " Paintball Centre through out the season. Call " & .Range("AA2").Text & "."
End With
myMsg = encodeURL(myMsg)
dest = "***"
sReq = "?mobile=" & sUser & "&pass=" & sPw & "&senderid=" & sId & "&to=" & dest & "&msg=" & myMsg
With CreateObject("MSXML2.xmlHttp") 'May need to change this to MSXML2.ServerXMLHTTP
.Open "POST", baseUrl & sReq, False
.setRequestHeader "Content-type", "application/x-www-form-urlencoded" 'You will need to find from vendor what headers are needed
.Send
resp = .responseText
ErrHandle:
If Err.Number <> 0 Then
'Do something
End If
End Sub
End With
End Sub
However it does not work.
Please help me
Bookmarks