Opening a dialog box to a specific path

mp52626
mp52626 used Ask the Experts™
on
How do I open a dialog box to a specific path?  This path is stored in a string variable pointing to a folder on the network.  This file dialog box should open to the specified folder and then allow the user to select a file inside of that folder.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dirk HaestProject manager

Commented:
Just use the .initdir from the common dialog box

example
Open dialog box, named cldGetFile
defaultimportdir = string from folder
cdlGetFile.InitDir = defaultImportDir
Commented:
the solution given by Dhaest is pretty good and should work.

The only thing you got to take care is whether you have permissions on the particular system on the network which you are specifying.

Dim strDir as string
strDir="\\SalesServer\Reports"
CommonDialog1.InitDir = strDir
CommonDialog1.ShowOpen

Author

Commented:
Great! This worked. Thank you so much!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial