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 / April 2005

Tip: Looking for answers? Try searching our database.

Get the current user of sharepoint in infopath form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy - 19 Apr 2005 13:28 GMT
Is there anyway that I can get the current logged in user of a sharepoint
server in infopath form ??
Bart - 19 Apr 2005 15:01 GMT
hi andy

assuming that are you are in a network using active directory

check out the following jScript about getting the logged in user name.

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

cheers
Bart

> Is there anyway that I can get the current logged in user of a sharepoint
> server in infopath form ??
Zuerk - 19 Apr 2005 21:38 GMT
This is also assuming this is a trusted form or that you have the
security permissions to run Active X controls on this form.
riya choudhary - 28 Apr 2005 08:23 GMT
Thanks Bart!!!!!!!11
I wanted this!!
 
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.