Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SUMPRODUCT search versus other method Serge Excel Discussion (Misc queries) 3 November 13th 06 09:14 AM
"Search for files and folders" option doesnot work for 100% ECouwenberg Excel Discussion (Misc queries) 7 January 11th 06 04:50 PM
Refine search criteria for Find Method ExcelMonkey Excel Programming 2 July 20th 05 03:03 PM
better search method jonny Excel Programming 3 February 25th 04 09:57 AM
Find Method ; search area CG Rosén Excel Programming 1 November 22nd 03 01:29 PM


All times are GMT +1. The time now is 02:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"