

These dialogs are meant to be used by users for specifying user files to open or to save. However, if an application is not run for a long time, its saved selected path is discarded. The algorithm for selecting the initial directory varies on different platforms.ġ.If lpstrInitialDir has the same value as was passed the first time the application used an Open or Save As dialog box, the path most recently selected by the user is used as the initial directory.Ģ.Otherwise, if lpstrFile contains a path, that path is the initial directory.ģ.Otherwise, if lpstrInitialDir is not NULL, it specifies the initial directory.Ĥ.If lpstrInitialDir is NULL and the current directory contains any files of the specified filter types, the initial directory is the current directory.ĥ.Otherwise, the initial directory is the personal files directory of the current user.Ħ.Otherwise, the initial directory is the Desktop folder.ġ.If lpstrFile contains a path, that path is the initial directory.Ģ.Otherwise, lpstrInitialDir specifies the initial directory.ģ.Otherwise, if the application has used an Open or Save As dialog box in the past, the path most recently used is selected as the initial directory. & "Err # " & Err.Number & " - " & Err.Description, _ MsgBox "The following error has occurred:" & vbNewLine _ MstrLastDir = Left$(strFileToOpen, InStrRev(strFileToOpen, "\") - 1)

StrBuffer = Input(LOF(intDemoFileNbr), intDemoFileNbr) Open strFileToOpen For Binary Access Read As #intDemoFileNbr
#Windows 7 add shortcut to save as dialog windows 7
NOTICE THAT YOUR INITIAL DIRECTORY IS NO LONGER ProjectProject BUT INSTEAD, ITS THE DESKTOP!!! This only happens on Windows 7 and once it's "Fixed," it seems to work great after that for any initial directory name and will always open in the directory initially no matter what. Click the button and open the text file on the desktop Create a new folder on the C drive named ProjectProjectĩ. My directory name is also 17 characters long and changing the length of the name is not an option.Ħ.
#Windows 7 add shortcut to save as dialog code
Add the following code into the form (notice that it is opening a file directory 17 characters long - "C:\ProjectProject").

Add a common dialog box named "dlgDemo"ĥ. Create a new form project in vb6 (standard exe).Ģ. I've been ghosting my machine and ghosting it back and that's how I can recreate it, fix it, and recreate it again.ġ. follow my steps exactly because once it stops doing it, it seems to stop doing it for good on that computer.
