Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA to look through all directories for drawings

Status
Not open for further replies.

jrice174

Civil/Environmental
Joined
Nov 8, 2004
Messages
129
Location
US
I attempting to write a VBA program that looks through all of our drawings for certain items (text, blocks, attributes, etc.). The program will begin with a browse window to select the directory where the search is to begin. It will look through all directories under this directory for AutoCAD files which it will open and look for the text or whatever it's looking for.

Any ideas on how to best do a directory search like this?
 
Do a google search on VB RECURSIVE SEARCH. This is a fairly common vb module used.

"Everybody is ignorant, only on different subjects." — Will Rogers
 
Thanks Borgunit
That's what I needed.
As usual you have come to my aid
Thanks again.
 
Private pFiles As New ArrayList

Public Sub GetFileListing(ByVal TargetDirectory)
Debug.WriteLine("Examining " & TargetDirectory)
For Each File As String In System.IO.Directory.GetFiles(TargetDirectory)
'Debug.WriteLine("Adding " & File & " to list")
Files.Add(File)
Next
For Each SubDirectory As String In System.IO.Directory.GetDirectories(TargetDirectory)
GetFileListing(SubDirectory)
Next
End Sub

Evan T. Basalik, MCSD
--------------------------------
It's all about prioritization...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top