Default Filepath question... How to???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,

I am working in VB6.0 with the common dialog control and am trying to create some code that will allow me to create/set a default filepath.

Here's what I want to do:

1) I want to bring up the common dialog control and allow the user to select a *FOLDER* (only a folder);

2) I then want to get the filepath to the selected *FOLDER* from the common dialog control,

3) I then want to close the common dialog control and store that *FOLDER* filepath in the windows registry.

The problem is this: How do you get the filepath to the selected folder from the common dialog control *without* actually "opening or saving a file"??? It can't be this hard... What am I doing wrong?!?!?

Thank you in advance,

blc
 
I tested the following code in an Excel Macro. After the first msgbox of
the folder, the dialog box opened, I moved to another foldere, clicked the
Cancel button, and the second CurDir msgbox showed the revised directory.
Hope this helps.
Ron Dahl

MsgBox CurDir
TheName = Application.GetOpenFilename( _
filefilter:="Excel Files (*.xls), *.xls", _
Title:="Load File")
MsgBox CurDir





blc said:
Hello all,

I am working in VB6.0 with the common dialog control and am trying to
create some code that will allow me to create/set a default filepath.
Here's what I want to do:

1) I want to bring up the common dialog control and allow the user to
select a *FOLDER* (only a folder);
2) I then want to get the filepath to the selected *FOLDER* from the common dialog control,

3) I then want to close the common dialog control and store that *FOLDER*
filepath in the windows registry.
The problem is this: How do you get the filepath to the selected folder
from the common dialog control *without* actually "opening or saving a
file"??? It can't be this hard... What am I doing wrong?!?!?
 
Back
Top