Help with this code pls!

AndyShuter

Registered User.
Local time
Today, 00:35
Joined
Mar 3, 2003
Messages
151
I am trying to send a sms measage by xml and have been given the following code.........




Sub test()
Dim xmlstring As String

Username = "user@mailaddress.com"
Password = "yourpass"
Message = "Your Message Here"
Destination = "447777777777"
xmlstring = "<?xml version=" & Chr(34) & "1.0" & Chr(34) & "?> " & _
"<Request xmlns:xsi=" & Chr(34) & "http://www.w3.org/2001/XMLSchema-instance" & Chr(34) & " xsi:noNamespaceSchemaLocation=" & Chr(34) & "http://schema.2sms.com/1.0/0410_RequestSendMessage.xsd" & Chr(34) & " Version = " & Chr(34) & "1.0" & Chr(34) & ">" & _
"<Identification>" & _
"<UserID><![CDATA[" & username & "]]></UserID>" & _
"<Password>" & password & "</Password>" & _
"</Identification>" & _
"<Service>" & _
"<ServiceName>SendMessage</ServiceName>" & _
"<ServiceDetail>" & _
"<SingleMessage>" & _
"<Destination>" & Destination & "</Destination>" & _
"<Text><![CDATA[" & Message & "]]></Text>" & _
"</SingleMessage>" & _
"</ServiceDetail>" & _
"</Service>" & _
"</Request>"

Dim xmlrequest As MSXML2.XMLHTTP
Set xmlrequest = New MSXML2.XMLHTTP
xmlrequest.Open "post", "http://web.2sms.com/xml/xml.jsp", False
xmlrequest.setRequestHeader "content-type", "text/xml"
xmlrequest.send xmlString

End Sub


I keep getting the message "User defined type not defined"

Any suggestions would be greatly appreciated

Thanks

Andy
 
Probably you don't have a reference set to this item...
Code:
Dim xmlrequest As MSXML2.XMLHTTP
CodeWindowMenu->Tools->References
 

Users who are viewing this thread

Back
Top Bottom