Attribute VB_Name = "InetFile" ' Function: GetInternetDirectory ' Description: Retreive the default directory used by the system to ' cache html files. Function GetInternetDirectory() As String 'Create a local file system object to create a path. Set fs = CreateObject("Scripting.FileSystemObject") Set WinFolder = fs.GetSpecialFolder(WindowsFolder) 'Construct a html path from the windows path. GetInternetDirectory = WinFolder.Path & "\Temporary Internet Files" 'Free the file system objects. Set WinFolder = Nothing Set fs = Nothing End Function ' Function: Scan ' Description: Scan the specified path for html files. Return the set ' of html files found in the path, including subdirectories, ' as a collection. Subdirectories will be searched by ' recursively calling this routine. Sub Scan(Dir As String, _ Results As Collection) 'Create a local file system object to search for HTML files. Set fs = CreateObject("Scripting.FileSystemObject") 'Get the root folder Set ffolder = fs.GetFolder(Dir) 'Get the subfolders for the root folder. Set sfolder = ffolder.SubFolders 'Recursively scan all subfolders in the root. Handle any 'new events between recursive calls. For Each fitem In sfolder Scan fitem.Path, Results DoEvents Next 'Get the files for the root folder. Set allfiles = ffolder.Files 'For each file, append it to a collection. For Each fileitem In allfiles If (fileitem.Type = "HTML Document") Or _ (fileitem.Type = "Microsoft HTML Document 4.0") Or _ (fileitem.Type = "Netscape Hypertext Document") Then Results.Add fileitem.Path End If Next 'Free the file system objects. Set allfiles = Nothing Set sfolder = Nothing Set ffolder = Nothing Set fs = Nothing End Sub