Saturday, January 10, 2004

Adding Logged in User Name

A fairly common task within an InfoPath form is to add the currently logged on user name (ie. network name) to a field in a form. Actually, this is fairly easy to do with a few lines of code and the WScript object.

 

// Load the originator name - this the person that opened the form

var objNetwork = new ActiveXObject("WScript.network");

XDocument.DOM.selectSingleNode("/approver:documentinformation/approver:

Originator").text = objNetwork.UserName;

 

If you wanted to perform this when the form opened you would add it to the OnLoad event.


11:21:23 PM    
comment [] trackback []

Sharepoint Category Added

I have added a new category to include some SharePoint Tips and Tricks. Keep an eye out in the new few weeks for hopefully some interesting stuff.

SharePoint Tips and Tricks

RSS Feed For SharePoint Tips and Tricks

Let me know if there is anything you would like to see.


11:38:05 AM    
comment [] trackback []