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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search and open a file

Status
Not open for further replies.

danvzla

Programmer
Jan 16, 2004
28
FI
Hi

I'm searching for a code that can take the name of a file, search in different folders and open it.

Inputs: Var with name of file and Initial path to start searching.

Output: Open file.

I will need to look on different folders and subfolders for the file.

Thanks.


 
Dan,

It is a bad habit to post duplicate questions all over the forums.

However, to answer your question:

Either use the File System Object (which I personally do not recommend, as user can disable WSH and trash your FSO code) or good old Dir function.

Dir recursively for folders and store them in an array.
Dir through folders until the file name is found...

When found, either Shell it or (if Access application) FollowHyperlink to it...

HTH

Again: have you noticed that there is only one letter difference between our screen names? This has already created a slight degree of confusion [smile]



[pipe]
Daniel Vlas
Systems Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top