Hi Craig,
Once you get your objNet initialized (new ActiveXObject("WScript.Network"),
you need to assign you objNet.UserName to:
XDocument.DOM.SelectSingleNode(full XPath for the root to field2), not just
field2. Your path should look like: /my:rootName/my:......./my:field2".
Hope that helps.
Franck Dauché
> I am trying to obtain the network username when an InfoPath form loads, then
> assign that username to a field in the form. I have tried many different
[quoted text clipped - 7 lines]
>
> Craig
craigster76 - 08 Sep 2005 17:39 GMT
Franck,
Thank you for your assistance. I have tried using the full xpath, but still
am unsuccessful. The full xpath looks like this:
XDocument.DOM.selectSingleNode("/my:myFields/my:field2") = objNet.UserName
Is my xpath incorrect?
Craig
> Hi Craig,
>
[quoted text clipped - 18 lines]
> >
> > Craig
Franck Dauché - 09 Sep 2005 02:46 GMT
No, you are fine, but you need a ".text" before the = sign...
Franck Dauché
> Franck,
>
[quoted text clipped - 29 lines]
> > >
> > > Craig
SDecou - 15 Mar 2006 20:25 GMT
I am receiving an error when I try to use ("WScript.Network") in Infopath
using VBScript. Have anyone been successful getting this to work? This is
what my code looks like:
Dim objNetwork
objNetwork = new ActiveXObject("WScript.network")
msgbox objNetwork
I am receiving an error and have tried using a SET statement which still
doesn't work.
> Hi Craig,
>
[quoted text clipped - 18 lines]
> >
> > Craig