Browse to a folder, not a file

M

M Skabialka

I am trying to automate a procedure to browse to a folder and the folder
name is then put in a text box for other functions to run. Those functions
work OK but I can't get the browse window to start in a specified folder -
it always starts at the root folder. The function I use is
SHBrowseForFolder.

I have found functions fGetBaseFileName and LaunchCD but they return a file
name, I only want a folder name.

Is there a function which will do this - browse to a certain default folder
then allow the user to select the subfolder they need (or browse anywhere
else)?

Mich
 
D

Dirk Goldgar

M Skabialka said:
I am trying to automate a procedure to browse to a folder and the folder
name is then put in a text box for other functions to run. Those functions
work OK but I can't get the browse window to start in a specified folder -
it always starts at the root folder. The function I use is
SHBrowseForFolder.

I have found functions fGetBaseFileName and LaunchCD but they return a
file name, I only want a folder name.

Is there a function which will do this - browse to a certain default
folder then allow the user to select the subfolder they need (or browse
anywhere else)?


I think this from Stephen Lebans is what you need:

http://www.lebans.com/callbackbrowser.htm
Functions to allow you to specify the opening folder to be
displayed when calling the Browser Folder Dialog window.
 
M

M Skabialka

This browses to a folder but starts at the root directory. How can it be
modified to start at a specified folder so the users only have to click once
to select the correct subfolder?

Mich
 
M

M Skabialka

This doesn't work if I set the folder to \\server01\folder\subfolder
I do this because users map the same folder to different drive letters...

Is there a work-around?
Mich
 
M

M Skabialka

Tricky - but it worked. I converted the UNC to a drive letter, did the
browse, then converted it back.
Thanks,
Mich
 
H

hor vannara

M Skabialka said:
This doesn't work if I set the folder to \\server01\folder\subfolder
I do this because users map the same folder to different drive letters...

Is there a work-around?
Mich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top