Loop through folders with shell object.

Hello,

I have this code that loops through networks folder/subfolders and search all files with plan in its name.

But it is take a long time to find all files, because of network folder, many subfolders and many files.

I have heard that it is possible to speed code up with shell object. Can anybody help me to get it to work with shell object?

Dim fso As FileSystemObject

Private Sub Command1_Click()

Dim fld As Folder

Dim ParentFolder As String

ParentFolder = "R: \Documents\Plans\"

‘ Set fso = New FileSystemObject

‘ Set fld = fso.GetFolder(""R: \Documents\Plans\")

Set objShell = CreateObject("Shell.Application")

Set fld = objShell.Namespace(ParentFolder)

RecursiveSearch fld, "plan.doc"

Set fld = Nothing

Set fso = Nothing

End Sub

View Complete Thread with Replies

No Reply.
Find related on my parent xResources.

Looking for something else? Search for it...

Tagged with: , , , ,

No Replies

There are still no reply for this post.

Leave your reply...

If you want to leave your reply for this post, simply fill out the next form:




You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .


Powered by: Wordpress & 3G Creations