johnlopez2000
Programmer
Colleagues,
I am attempting to load a script file at runtime into an HTA application. Works fine when the code is local in the HTA, but I want to have it is a seperate file:
//-----------------------------
test.hta content:
//-----------------------------
//-----------------------------
test.vbs content:
//-----------------------------
Thanks very much for your help.
John Lopez
Enterprise PDM Architect
john.l.lopez@goodrich.com
I am attempting to load a script file at runtime into an HTA application. Works fine when the code is local in the HTA, but I want to have it is a seperate file:
//-----------------------------
test.hta content:
//-----------------------------
Code:
<html>
<head>
</head>
<script type="VBScript" src="C:\temp\test.vbs"></script>
<body>
<textarea name="ScriptArea1" rows=5 cols=40></textarea><P>
<P><input type="button" value="Refresh Status" name="Test" onClick="TestSub"><p><P>
</body>
</html>
//-----------------------------
test.vbs content:
//-----------------------------
Code:
dim xFile
xFile = "c:\tmp\chat.txt"
Sub TestSub
ScriptArea1.value = vbNewLine & readFile(xFile)
end sub
function readFile(xfile)
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(xfile, ForReading)
strText = objFile.ReadAll
objFile.Close
readFile = strText
end function
Thanks very much for your help.
John Lopez
Enterprise PDM Architect
john.l.lopez@goodrich.com