List Folders and Files on a Form

  • Thread starter Thread starter Dwight
  • Start date Start date
D

Dwight

How can I create a form that displays Folders and Files
simular to Windows Explorer?

I have a network folder that has several sub-folders. I
would to have the folders displayed in 1 control and the
files displayed in another control.

Thanks in advance!

Dwight
 
For what purpose? To select a file? An easier approach would be to use the
Window File Save/Open API. You can find information about it and how to use
it here:
http://www.mvps.org/access/api/api0001.htm

If that won't work for you for some reason, I have a small sample database
on my website (see sig below) which illustrates how to do what you want.
It's called "DirectoryList.mdb"
 
I want to be able to locate and open files from in its own
application window.

Thanks!

Dwight
 
OK, you should be able to locate the files through the use of the API as I
described. I have a couple of samples on my website (see sig below) which
use this process: "SaveFileToSpecificDirectory.mdb" and "SetHyperlink.mdb".
However, all this does is return the path and file name. Actually launching
it in the associated application is another thing.

At this point, I'm not sure how you'd do that. I believe the Shell()
function requires you to specify the application, so you would have to
create your own file association.

Another thought is to use the Shell() function to open Explorer itself. For
example:

Sub Shell1()
Dim htask As Integer
htask = Shell("explorer.exe", vbNormalFocus)
End Sub

this code will open MyDocuments in Explorer. From there, you can navigate
anywhere and have all the funtionality of Explorer, because that's what
you've got.
 
Back
Top