Folder that VB shows for open

How can I change the default folder the Visual Basic 6.0 displays when I select the "open" menu item?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

This is my open folder code. Com1 is my control and the initdir is where you change the folder.

With Com1
   .CancelError = True
   .Flags = cdlOFNHideReadOnly
   .InitDir = "c:\temp\bin"
   .FilterIndex = 1
End With

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pentominoAuthor Commented:

Thanks, but what do I do with the code?  I am a bit of a Novice.

Ok I tell you how to design a demo project so you can have a play with it and learn what you can and can't do with it.

Create a new project.
Add a command button.
Add a Common dialog control (should be on the default componant bar)
Call the Dialog control com1
Double click on the command button and paste the code I have put in my answer behind it.

To change the folder on the open folder just change the follow string after the .init  

Hope this helps
pentominoAuthor Commented:

I don't think you understand, or maybe I didn't make myself clear.

I wanted the menu item  File->Open project  to always start in a certain folder.  Not when a program is running,, but when I start up Visual Basic, and want to open a project.

Hope I am clear on what I need.

Yes you are clear. I understand what you want. I'm looking for the same thing. I don't known if an external option exist to do that for the Exist Tab of the dialog Box.
But I have a Vb Add-in to recall the last programm loaded in the previous Vb loggin.
It's a VB6 version of an VB5 release is on ( called Restore ).
If you wish the VB6 release send me your
email to
Bye Michel
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.