Get UserName

B

BroRick

The following code works perfectly when I use it with a C# Infopath
template. I am not familiar with C # and therefore I am limited as to
what else I can do with the form. Can anyone tell me how to convert
the following code to VB script. Thank you in advance.

IXMLDOMNode nodeEmployee =
thisXDocument.DOM.selectSingleNode("my:myFields/my:employee");
if(nodeEmployee != null)
{
if(nodeEmployee.text == "")
{
// if the employee name is blank when we load the form,
// populate the employee node with the current user name
nodeEmployee.text = System.Environment.UserName;
}
}
 

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