
Please look over the code below and find the problem.
The code I used is:
Option Explicit
Dim filename, Title, h1
Dim fs, f
While NOT IsAlphaNumeric(filename)
If filename <> "" AND NOT IsAlphaNumeric(filename) Then
MsgBox "FileName must be alphanumeric, without spaces!",16,"PageCreator"
End If
filename = InputBox("Enter FileName (without file extenison):","PageCreator")
Wend
While NOT IsAlphaNumeric(Title)
If Title <> "" AND NOT IsAlphaNumeric(Title) Then
MsgBox "Title must be alphanumeric, without spaces!",16,"PageCreator"
End If
Wend
While NOT IsAlphaNumeric(h1)
If filename <> "" AND NOT IsAlphaNumeric(h1) Then
MsgBox "Heading must be alphanumeric, without spaces!",16,"PageCreator"
End If
h1 = InputBox("Enter Heading to appear on page:","PageCreator")
Wend
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile(Trim(filename) & ".html",2,True)
f.WriteLine("<!DOCTYPE html>
<html>
<head>")
f.Write("<title>""" & Title & """</title>
<link rel="shortcut icon" href="favicon.png">
<link href="Site.css" rel="stylesheet"></head>
<body>
<nav id="nav01"></nav>
<div id="main">
<h1>""" & Heading & """</h1>
<footer id="foot01"></footer>
</div>
<script src="Script.js"></script>
</body>
</html>;")
Set f = Nothing
Set fs = Nothing
MsgBox "Password file created!"
Function IsAlphaNumeric(str)
Dim ianRegEx
Set ianRegEx = New RegExp
ianRegEx.Pattern = "^[a-zA-Z0-9]+$"
ianRegEx.Global = True
IsAlphaNumeric = ianRegEx.Test(str)
End Function