mixmaster1
Technical User
Hi All
Trying to get this to write to a Text file but keeps giving me an error "path not pound" line 22 Char 1
Any help you can give would be greatly appreciated..
Trying to get this to write to a Text file but keeps giving me an error "path not pound" line 22 Char 1
Any help you can give would be greatly appreciated..
Code:
<html>
<head>
<script language="vbscript">
Sub ndhta
Set objShell = CreateObject("WScript.Shell")
objShell.Run("2ndhta.hta")
window.close "close this HTA"
End Sub
</script>
<script language="vbscript">
Sub SaveData
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("C:\Scripts\Test.tsv") Then
Set objFile = objFSO.OpenTextFile("C:\Scripts\Test.tsv",8)
strLine = Aud.Value & vbTab & AFM.Value & vbTab & Hod.Value & vbTab & Van.Value & vbTab & Acc.Value & vbTab & Job.Value & vbTab & Work.Value & vbTab & DWC.Value & vbTab & Tech.Value & vbTab & TechId.Value & vbTab & Cust.Value & vbTab & Post.Value
objFile.WriteLine strLine
objFile.Close
Else
Set objFile = objFSO.CreateTextFile("C:\Scripts\Test.tsv")
strLine = Aud.Value & vbTab & AFM.Value & vbTab & Hod.Value & vbTab & Van.Value & vbTab & Acc.Value & vbTab & Job.Value & vbTab & Work.Value & vbTab & DWC.Value& vbTab & Tech.Value & vbTab & TechId.Value & vbTab & Cust.Value & vbTab & Post.Value
objFile.WriteLine strLine
objFile.Close
End If
End Sub
</script>
<HTA:APPLICATION
APPLICATIONNAME="Live Audit HTA"
SYSMENU="yes"
border="thin"
borderstyle="raised"
maximizebutton="no"
minimizebutton="no"
scroll="no"
version="1.0"
>
<title>Audit Information</title>
<link rel="stylesheet" type="text/css" href="style.css">
<style type="text/css">
<style type="text/css">
body {background-color:#FFFFFF;}
p {font:bold 18px arial;}
</style>
</head>
<script language="javascript">
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height);
</script>
<Body>
<form>
<div id="footer" style="background-color:#FFA500;clear:both;text-align:center;">
Field Technician Live Audit</div><BR><BR><BR><BR><BR>
<img style= "position:absolute; top: 40px; Left:950px; width:150px; height:90px" src="qual.jpg">
<table border="5" style="z-index: 1; position: inline; width: 1120px; height: 10px; left: 0px; top: 100px;" width="500" ; align = center>
<tbody>
<tr align="center" valign="top">
<td scope="col"><strong>Auditors Name: <br /></strong></td>
<td><input id="Aud" maxlength="55" name="Aud" size="35" type="text" /></td>
</tr>
<tr align="center" valign="top">
<td scope="col"><strong>AFM: <br/></strong></td>
<td><input id="AFM" maxlength="55" name="AFM" size="35" type="text" /></td>
</tr>
<tr align="center" valign="top">
<td scope="col"><strong>HOD Region: <br/></strong></td>
<td><input id="Hod" maxlength="55" name="Hod" size="35" type="text" /></td>
</tr>
<tr align="center" valign="top">
<td scope="col"><strong>Vehicle Registration: <br/></strong></td>
<td><input id="VAN" maxlength="55" name="Van" size="35" type="text" /></td>
</tr>
<tr align="center" valign="top">
<td scope="col"><strong>Account Number: <br/></strong></td>
<td><input id="ACC" maxlength="55" name="ACC" size="35" type="text" /></td>
</tr>
<tr align="center" valign="top">
<td scope="col"><strong>Job Characteristics: <br/></strong></td>
<td><input id="Job" maxlength="55" name="Job" size="35" type="text" /></td>
</tr>
<tr align="center" valign="top">
<td scope="col"><strong>Work Undertaken: <br/></strong></td>
<td><input id="Work" maxlength="55" name="Work" size="35" type="text" /></td>
</tr>
<tr align="center" valign="top">
<td scope="col"><strong>Date Work Completed: <br/></strong></td>
<td><input id="DWC" maxlength="55" name="DWC" size="35" type="text" /></td>
</tr>
<tr align="center" valign="top">
<td scope="col"><strong>Technician Name: <br/></strong></td>
<td><input id="Tech" maxlength="55" name="Tech" size="35" type="text" /></td>
</tr>
<tr align="center" valign="top">
<td scope="col"><strong>Technician ID: <br/></strong></td>
<td><input id="TechId" maxlength="55" name="TechId" size="35" type="text" /></td>
</tr>
<tr align="center" valign="top">
<td scope="col"><strong>Customer Address: <br/></strong></td>
<td><input id="Cust" maxlength="55" name="Cust" size="35" type="text" /></td>
</tr>
<tr align="center" valign="top">
<td scope="col"><strong>Post Code: <br/></strong></td>
<td><input id="Post" maxlength="55" name="Post" size="35" type="text" /></td>
</tr>
</tr>
</tr>
</tbody>
</table><BR><BR>
<table width="100%">
<tbody>
<tr align="center" valign="top">
<td><input type="button" value="Save" name="save_button" onClick="SaveData"><p></p></td>
</tr>
</tr>
</tbody>
</table>
<div style="position: absolute; bottom: 0;">
<input type="button" value="Continue" name="continue_button" onClick="ndHta"><p></p></div>
</form>
<SPAN class=sig><font color="#ff0000">
Developed By Alfredo Parducci - Virgin Media - 2014.</font>
</SPAN>
</body>
</html>