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 / March 2006

Tip: Looking for answers? Try searching our database.

Capture User Name / User ID

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill - 23 Mar 2006 02:00 GMT
I would like to capture the network user name / user ID when a check box is
clicked or when a date is set (date picker control box) by a user.  I have a
checklist that needs to track who approved the action and when.
Sandeep - 28 Mar 2006 09:15 GMT
Hi Bill
You can write code in jscript.

var wshShell = new ActiveXObject("Wscript.Shell");
var wshEnv = wshShell.Environment("Process");
var username = wshEnv.Item("UserName");
XDocument.DOM.selectSingleNode("/my:myFields/my:name").text = username

Signature

Sandeep
www.autonomysystems.com

dkru - 28 Mar 2006 16:34 GMT
Hi Sandeep,

I believe this code will be very helpful, but I'm struggling with the ("/my:
myFields/my:name") line of code.

I have a number of fields in my tree and feel it should look like this:

("/my:myFields/dataFields/d:ITChange/Approver")

I see in your code you include (/my:my....) Is there an easier way to find
the proper path if I'm using multiple groups etc?

Thanks,

Dennis

>Hi Bill
>You can write code in jscript.
[quoted text clipped - 3 lines]
>var username = wshEnv.Item("UserName");
>XDocument.DOM.selectSingleNode("/my:myFields/my:name").text = username
 
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.