Just a little question about creating webpages in MS word.
I'd like to use the below code to count the number of pagehits.
It runs fine when i run it from the MS Script editor in word, but when i save it to a *.html file the script doesn't seem to run at all and i get a message in the statusbar of Internet explorer that the page is loaded but with errors.
I'm totaly lost here, could someone help me out?
regards, Bart
Code: Select all
<script language="VBScript" runat="server" TYPE="text/vbscript">
function CountHits()
dim readline,OldVal
dim fso, MyFile
dim count
dim ACount
set fso = CreateObject("Scripting.FileSystemObject")
set MyFile = fso.opentextfile("H:\Werkplaats\Procedure web\Main_files\TotalCount.txt",1)
count = MyFile.ReadLine
count = count+1
MyFile.Close
set MyFile = fso.CreateTextFile("H:\Werkplaats\Procedure web\Main_files\TotalCount.txt",true)
MyFile.Writeline(count)
MyFile.Close
ACount = Cstr(count)
document.write(ACount)
end function
CountHits()
</script>




