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.

why this code isn't work ??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nathan - 25 Apr 2005 05:16 GMT
var oNetwork = new ActiveXObject("WScript.Network");
var strUserName = oNetwork.UserName;
XDocument.DOM.selectsingleNode("/my:myFields/my:Username").text = strUsername;

always get message : "Object doen't support this property or method"
I just want to get the username into a textbox.

yupp! I'm a beginner, so please help...
thx
Teuvo Tarvainen - 26 Apr 2005 04:45 GMT
Try this one:

var oNetwork = new ActiveXObject("WScript.Network");
var strUserName = oNetwork.UserName;
XDocument.DOM.selectSingleNode("/my:myFields/my:Username").text =
strUserName;

Be careful with Upper  and  Lower cases

Hope this helps,

Teuvo

> var oNetwork = new ActiveXObject("WScript.Network");
> var strUserName = oNetwork.UserName;
[quoted text clipped - 5 lines]
> yupp! I'm a beginner, so please help...
> thx
Nathan - 29 Apr 2005 08:56 GMT
Thx 4 the clue...  I guess i'm quite careless enough... =b
however still got an error message :
'XDocument.DOM.selectSingleNode(...)' is null or not an object

rgrds,
NBW

> Try this one:
>
[quoted text clipped - 19 lines]
> > yupp! I'm a beginner, so please help...
> > thx
Nathan - 29 Apr 2005 09:15 GMT
I'm so sorry Teuvo... =)
my mistake.. urgghh... (again n again...)

I change my code a little bit :
XDocument.DOM.selectSingleNode("//my:Username").text = strUserName;

everything is work fine now, Thanks a lot
=)

> Thx 4 the clue...  I guess i'm quite careless enough... =b
> however still got an error message :
[quoted text clipped - 26 lines]
> > > yupp! I'm a beginner, so please help...
> > > thx
 
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.