Deriving the full name of a subdirectory from the first fewCharacters

  • Thread starter Thread starter robboll
  • Start date Start date
R

robboll

Is it possible to derive the full subdirecory name from the first few
characters of the subdirectory?

In other words, if we know that TID(123) is part of the subdirectory
name:

"\\MyServer\MyFolders\TID(123) a folder description goes here\"

So if I start with a common base folder:
"\\MyServer\MyFolders\"

What code can be used to return the complete path using just "TID
(123)" as the search string?

In DOS if you use a wildcard dir \\MyServer\MyFolders\TID(123)* it
will return the full path.

I'm looking for the same thing using strictly VBA? Is this possible?

Thanks for any help with this.

RBollinger
 
On Wed, 23 Dec 2009 18:49:53 -0800 (PST), robboll

You can use the Dir function to iterate over the items in a folder,
inspecting their name, and if you like what you see you can take
action. There is a good example in the Help file.

-Tom.
Microsoft Access MVP
 
Try

Dir("\\MyServer\MyFolders\TID(123)*",vbDirectory)

That will return the name of the directory, but you will have to append the
"\\MyServer\MyFolders\" to the name of the directory.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top