Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Open text file on load

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,3436
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Open text file on load
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Open text file on load - 6/17/2005 9:22:52 PM   
  gibbo1715

 

Posts: 52
Score: 0
Joined: 6/8/2005
From:
Status: offline
Help again, i can open a text file as part of my html page using a sub with the click of a button using <DIV ID="DIVTAG"></DIV>, how can I open a text file immediately the page loads, i ve tried
<SCRIPT type=text/vbscript>

Dim f, fso, NewFile

Set f = fso.OpenTextFile("C:\Documents and Settings\Paul\My Documents\data.txt", ForReading)
NewFile = f.ReadAll

DIVTAG.InnerHTML = NewFile

</SCRIPT>

but i get an error at the Set f line?

Thanks in advance for your help
 
 
Post #: 1
 
 Re: Open text file on load - 6/17/2005 11:54:12 PM   
  gibbo1715

 

Posts: 52
Score: 0
Joined: 6/8/2005
From:
Status: offline
Found a way around this by creating a sub called display to read the file, then using <Body onload="Display"> to call the sub Display, seems to work ok for me

(in reply to gibbo1715)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Open text file on load Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts