K
Keith H
I am a newbie with InfoPath. Trying to set up a form with a scripted submit
event. Here is the VBScript I have:
Sub XDocument_OnSubmitRequest(eventObj)
' If the submit operation is successful, set
' eventObj.ReturnStatus = True
' Write your code here
dim strURL = XDocument.Solution.URI
strURL = Replace(strURL, "poreq.xsn", "post.aspx")
dim oXmlHttp as new ActiveXObject("MSXML2.XMLHTTP")
oXmlHttp.Open("PUT", strURL, false)
oXmlHttp.Send(XDocument.DOM.xml)
if (oXmlHttp.Status = 200 or oXmlHttp.Status = 201) then
eventObj.ReturnStatus = True
else
eventObj.ReturnStatus = False
end if
'XDocument.UI.Alert(XDocument.Solution.URI)
End Sub
Using this, I get an error when trying to open the form:
Expected end of statement
File:script.vbs
Line:24
dim strURL = XDocument.Solution.URI
I am used to VB.NET, and I don't know if there is some slight difference I'm
missing using VBScript...or if it is some other problem?
event. Here is the VBScript I have:
Sub XDocument_OnSubmitRequest(eventObj)
' If the submit operation is successful, set
' eventObj.ReturnStatus = True
' Write your code here
dim strURL = XDocument.Solution.URI
strURL = Replace(strURL, "poreq.xsn", "post.aspx")
dim oXmlHttp as new ActiveXObject("MSXML2.XMLHTTP")
oXmlHttp.Open("PUT", strURL, false)
oXmlHttp.Send(XDocument.DOM.xml)
if (oXmlHttp.Status = 200 or oXmlHttp.Status = 201) then
eventObj.ReturnStatus = True
else
eventObj.ReturnStatus = False
end if
'XDocument.UI.Alert(XDocument.Solution.URI)
End Sub
Using this, I get an error when trying to open the form:
Expected end of statement
File:script.vbs
Line:24
dim strURL = XDocument.Solution.URI
I am used to VB.NET, and I don't know if there is some slight difference I'm
missing using VBScript...or if it is some other problem?