Home All Groups Group Topic Archive Search About

Default folder in common dialogs

Author
4 Jun 2005 9:53 PM
Dan
In the File Open and File Save common dialogs, is there a way to specify the
folder that should be presented when the dialog is displayed? Is there a way
to specify a default file name that is highlighted in that folder if it
exists?

-Dan

Author
5 Jun 2005 12:45 PM
MikeD
"Dan" <D**@discussions.microsoft.com> wrote in message
news:BA00DEE5-F844-4CB8-8B98-71758AE8A39C@microsoft.com...
> In the File Open and File Save common dialogs, is there a way to specify
> the
> folder that should be presented when the dialog is displayed? Is there a
> way
> to specify a default file name that is highlighted in that folder if it
> exists?


Presumably you are using the Common Dialog Control.

To set the initial directory, assign that folder to the InitDir property of
the CDC.  To my knowledge, there's no way to actually pre-select a file in
the list, but you can assign a file name to the FileName property before
showing the dialog box.


--
Mike
Microsoft MVP Visual Basic

Bookmark and Share