Scripted Submit Problem

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top