Folder that VB shows for open

Posted on 1999-11-22
Medium Priority
Last Modified: 2011-09-20
How can I change the default folder the Visual Basic 6.0 displays when I select the "open" menu item?

Question by:pentomino
  • 2
  • 2

Accepted Solution

bja1 earned 300 total points
ID: 2227535
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

Author Comment

ID: 2228036

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


Expert Comment

ID: 2228489
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

Author Comment

ID: 2228835

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.


Expert Comment

ID: 5071081
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
http://mainsoft.com ( called Restore ).
If you wish the VB6 release send me your
email to mrodenas@club-internet.fr.
Bye Michel

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

594 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question