Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / August 2004

Tip: Looking for answers? Try searching our database.

Get User Name in a Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Juli V. - 26 Aug 2004 08:58 GMT
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:

>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!
Josh Bertsch [MSFT] - 26 Aug 2004 21:26 GMT
What is the error that you are seeing?

--josh bertsch

> Hello!
> I've read everything in this newsgroup about the subject, but still can't
[quoted text clipped - 30 lines]
>
> thnx!
Juli V. - 27 Aug 2004 04:20 GMT
Oh! That's all! I've done it! My problem was in security. I've set my form
to Full Trust and everything is ok now!

Thanks anyway!

> What is the error that you are seeing?
>
[quoted text clipped - 37 lines]
>>
>> thnx!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.