#1
For Each fileItem in curFiles
fname = fileItem.Name
fext = InStrRev( fname, "." )
If fext < 1 Then fext = "" Else fext = Mid(fname,fext+1)
ftype = fileItem.Type
fsize = fileItem.Size
fcreate = fileItem.DateCreated
fmod = fileItem.DateLastModified
faccess = fileItem.DateLastAccessed
currentSlot = currentSlot + 1
If currentSlot > UBound( theFiles ) Then
ReDim Preserve theFiles( currentSlot + 99 )
End If
' note that what we put here is an array!
theFiles(currentSlot) = Array(fname,fext,ftype,fsize,fcreate,fmod,faccess)
Next
in this coding the variable 'fext' contains the file extension, so only thing you need to do is filter out the .htm and .html files
for example:
For Each fileItem in curFiles
fname = fileItem.Name
fext = InStrRev( fname, "." )
If fext < 1 Then fext = "" Else fext = Mid(fname,fext+1)
If LCase(CStr(fext)) = LCase(CStr("htm"

) Or LCase(CStr(fext)) = LCase(CStr("html"

) Then
ftype = fileItem.Type
fsize = fileItem.Size
fcreate = fileItem.DateCreated
fmod = fileItem.DateLastModified
faccess = fileItem.DateLastAccessed
currentSlot = currentSlot + 1
If currentSlot > UBound( theFiles ) Then
ReDim Preserve theFiles( currentSlot + 99 )
End If
' note that what we put here is an array!
theFiles(currentSlot) = Array(fname,fext,ftype,fsize,fcreate,fmod,faccess)
End If 'for file extension check
Next
#3 check out
you could write a function that opens the file as described in the above url and then search it by using a regular expression for the stuff between <title> tags. I guess it would be easiest if you place the title in an extra value in the array.
theFiles(currentSlot) = Array(fname,fext,ftype,fsize,fcreate,fmod,faccess, GiveMeTitle(fname))
instead of:
theFiles(currentSlot) = Array(fname,fext,ftype,fsize,fcreate,fmod,faccess)
Function GiveMeTitle(sFileName)
'coding here for opening the file as textstream !
coding for the regular expression:
'let's assume sTextStream is the textstream
Dim oRegExp, oMatch, sMatch, sTitle
Set oRegExp = new regexp
oRegExp.IgnoreCase = True
oRegExp.Global = True
'this is the regular expression:
oRegExp.Pattern = "(<title>)(\s*\n|.+?\s*)(</title>)"
'test it against the stream:
Set oMatch = oRegExp.Execute( sTextStream )
For Each sMatch IN oMatch
'there will only be one match usually (or none)
'we need the second subpart of the regular expression (what's between the tags)
sTitle = sMatch.SubMatches(1)
Next
Set oRegExp = NOTHING
Set oMatch = NOTHING
If Len(sTitle) > 0 Then
'we found a title
End If
GiveMeTitle = sTitle
End Function
I didn't test it, hope it contains no errors
and i think this code will be slow for large folders (with many files)...
greetings