J
Juli V.
Hello!
I've read everything in this newsgroup about the subject, but still can't
hadle with it!
Need help, please!!
I don't want to use Visual Studio .NET to create a Form (like in Lab #15 on
MSDN library), I want to write JScript inside InfoPath.
So I found a solution here:
But it doesn't work! This code stop working after the first string:
I couldn't find nothing about "WScript.network" - I think such definition
doesn't exist. So I don't know how I can solve this problem!
Please, if I'm wrong and somebody know a solution, point me on it!
thnx!
I've read everything in this newsgroup about the subject, but still can't
hadle with it!
Need help, please!!
I don't want to use Visual Studio .NET to create a Form (like in Lab #15 on
MSDN library), I want to write JScript inside InfoPath.
So I found a solution here:
In JScript:
function XDocument::OnLoad(eventObj)
{
//Create a WScript.Network object, which provides access to the user data
var objNetwork = new ActiveXObject("WScript.network");
//Retrieve the UserName and write it into the my:UserName field
XDocument.DOM.selectSingleNode("/my:myFields/my:UserName").text =
objNetwork.UserName;
//Retrieve the UserDomain and write it into the my:UserDomain field
XDocument.DOM.selectSingleNode("/my:myFields/my:UserDomain").text =
objNetwork.UserDomain;
//Retrieve the ComputerName and write it into the my:ComputerName field
XDocument.DOM.selectSingleNode("/my:myFields/my:ComputerName").text =
objNetwork.ComputerName;
}
But it doesn't work! This code stop working after the first string:
var objNetwork = new ActiveXObject("WScript.network");
I couldn't find nothing about "WScript.network" - I think such definition
doesn't exist. So I don't know how I can solve this problem!
Please, if I'm wrong and somebody know a solution, point me on it!
thnx!