×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

VBA to look through all directories for drawings

VBA to look through all directories for drawings

VBA to look through all directories for drawings

(OP)
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?

RE: VBA to look through all directories for drawings

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

RE: VBA to look through all directories for drawings

(OP)
Thanks Borgunit
That's what I needed.
As usual you have come to my aid
Thanks again.

RE: VBA to look through all directories for drawings

    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...

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources