bcbii Level: Trainee
 Registered: 06-04-2005 Posts: 2
|
Search for a directory containg certain characters
Hi,
I am trying to save a document to a sepcific folder. This folder name will contain a number and a description ie.
c:\345 testing this\
The user will enter the number in the dialog. There are a lot of folders all with a different number and different description; too many to write an if statement to get the whole folder name.
I have a few ideas, I could generate a list of all the folders in a specified directory, search for the entered number in the list, and return the full folder name.
Or was thinking I could use a wildcard in the save path for the document. So the program searches for the only folder with those numbers, something like this:
number = txtNumber.Text 'grab the folder number from a text box
directory = "c:\" & number & " *\document.txt"
once the number has been chosen (say they entered 345 into the text box txtNumber), directory would look like:
c:\345 *\document.txt
Really all i am trying to do is search for a folder whose name contains the entered number, and save the document in that folder
Thank you for your help
|