return user name

P

poor_man

hi,

iam useing infopath 2003 sp2 ,can i return curunt user name to a text box in
infopath??

pleas help

Thanks
 
P

poor_man

Dear Senthil Kumar D,

Thanks you it was help full link

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;
}


it also can retrive computer name

Regards
sameh
 

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