loading

How could I load a txt file into a HTA (HTML Application) Multi-line Textbox?

Hello, I have an HTA file in it is a multi line textbox, I would like to load a txt file into this textbox. the script language is VBScript here is the textbox


 <textarea name="ScriptArea" rows=20 cols=70></textarea><p>


Thanks in advance 1Animan

g-one6 years ago

Try this (text from file "Test.txt"):


<html>
   <head>
     <title>TEST</title>
     <hta:application scroll="no" windowState="normal">
  </head>
  <script language="VBScript">
     sub Window_onLoad()
     set oFSO=CreateObject("Scripting.FileSystemObject")
     set oFile=oFSO.OpenTextFile("Test.txt",1)
     text=oFile.ReadAll
     document.all.ScriptArea.value=text
     oFile.Close
     end sub
  </script>
  <body>
     <textarea name="ScriptArea" rows=20 cols=70></textarea><p>
   </body>
</html>

animan1 (author)  g-one6 years ago
Thanks, that was perfect. I just dont want it to load when the window starts but i know perfecctly how to Change that that

This is exactly what I was looking for :)