If you see the reference for the OPENFILENAME
structure, you will see that for the lpstrInitialDir
field it states that:
If
lpstrInitialDir
has the same value as was passed the first time the application used anOpen
orSave As
dialog box, the path most recently selected by the user is used as the initial directory.
This means that the lpstrInitialDir
field can really only be used the first time you use the dialog in a program. The rest of the time it will use the last directory selected by the user.