I have six Excel spreadsheets in a folder. I would like to display the three filenames as hyperlinks that start with W in one table cell and the ones that start with M in the other table cell.

My code (see below) successfully displays ALL the files in the folder, but only in one table cell. I need a second code to go in the second table cell to display the M files. I have commented my code, so I trust this helps to define better what I am trying to accomplish.

Help is always appreciated.



<%dim strPath

strPath = "D://Wwwroot/test/ID01/"

dim oFS, oFile, oFolder, oFolderContents, slot, variablename

Set oFS = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFS.getFolder(strPath)

for each oFile in oFolder.files

'create function to read first char in filename
'if filename starts with W then display in weekly column
'if filename starts with M then display in monthly column


'This code creates the list of hyperlinks to each of the files.

<A href="<%response.write oFile.Name%>">
<%response.write oFile.Name%></a><br>

'I need the second code for M files here.