Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search Folders Method
i am using the FileSearch.SearchFolders method, and I want to search folders, for other folders. What mso* object can I use? Do I need to add a new reference? Right now, the best that I can find is msoFileTypeAllFiles, but that returns too many objects. Many thanks in advance Justin -- turnerje ------------------------------------------------------------------------ turnerje's Profile: http://www.excelforum.com/member.php...o&userid=25694 View this thread: http://www.excelforum.com/showthread...hreadid=473093 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search Folders Method
I'm not exactly sure what you will do with the folders but try this. Option Explicit ' Add Reference Microsoft Scripting Runtime Public Sub FindFolders() Dim fsoFileSystemObject As FileSystemObject Dim parentFolder As Folder Dim collectionOfFolders As Folders Dim childFolder As Folder Dim strTemp As String Set fsoFileSystemObject = CreateObject("Scripting.FileSystemObject") Set parentFolder = fsoFileSystemObject.GetFolder("C:\") Set collectionOfFolders = parentFolder.SubFolders For Each childFolder In collectionOfFolders strTemp = strTemp + childFolder.Name + vbCrLf Next MsgBox strTemp End Sub Good luck. *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SUMPRODUCT search versus other method | Excel Discussion (Misc queries) | |||
"Search for files and folders" option doesnot work for 100% | Excel Discussion (Misc queries) | |||
Refine search criteria for Find Method | Excel Programming | |||
better search method | Excel Programming | |||
Find Method ; search area | Excel Programming |