I am using the following code to pull the username of the person accessing my infopath form and insert their name into a field called Signature1:
dim x
var x = new ActiveXObject("Wscript.Network")
dim user
user = x.UserName
XDocument.DOM.selectSingleNode("/my:myFields/my:Signature1").text = user
When I run the form, I get the following error:
InfoPath cannot open the selected form because of an error in the form's code.
The following error occurred:
Invalid character
File:script.vbs
Line:17
var x = new ActiveXObject("Wscript.Network");
Any ideas???