Ok so I am using the code below to read and display text files into a HTA with VBScript, it loops through all the text files present in a folder (Notes). I have it parsing returns and have removed the file extension from display.
What I would like to do is build 2 arrays, one for the file names, one for the text file content so I can use them in other parts of the script to output as needed.
I understand I need a dynamic array as such within the loop it needs to expand it's intsize, it's just the implementation I am unsure of, particulary as it could probably be a 2 dimensional array to keep the filename and it's content together. Here is the code.
Set objFSO = CreateObject("Scripting.FileSystemObject")
objStartFolder = "Notes\"
Set objFolder = objFSO.GetFolder(objStartFolder)
Set colFiles = objFolder.Files
For Each objFile in colFiles
If UCase(objFSO.GetExtensionName(objFile.name)) = "TXT" Then
Files = objStartFolder & objFile.name
Set objReadFile = objFSO.OpenTextFile(Files, 1)
strExt = Left(objFile.name, Len(objFile.name)-4)
strNote = Replace(objReadFile.ReadAll, vbCRLF, "<br>")
objReadFile.Close
document.write strExt & "<br><br>"
document.write strNote & "<br><br>"
else
document.write ="File was empty"
End If
Next