Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep 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
Nov 8, 2004
129
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?
 
Replies continue below

Recommended for you

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