'フォルダ以下のファイルリストを取得する Public Function GetFileList(strDirPath$, Optional colFileList As Collection = Nothing) As Collection Dim f With mFSO.GetFolder(strDirPath) For Each f In .SubFolders GetFileList f.Path, colFileList Next If colFileList Is Nothing Then Set colFileList = New Collection For Each f In .Files colFileList.Add f Next End With Set GetFileList = colFileList End Function