I’ve spent more than an hour on this and done enough reading. I’m stumped. Surely this must be programming 101? - perhaps I’m stumbling with a certain method or syntax.
I have File Open and File Import
On File Open, the user is pointed to the folder that contains previously saved files ready to open:
dlg.InitialDirectory = SpecialFolder.ApplicationData.Child(myAppDataFilesFolder)
All good - this works as expected.
When “importing” files, AND on application startup, the program points the user to a default position:
dlg.InitialDirectory = SpecialFolder.Desktop
From then on, if the user wants to import files, then my program should take them the last directory/folder that they have imported a file from.
It seems by default the OS always takes you back to the last folder you were at anyway, which makes sense. So, I almost need do nothing. BUT if the user opens a file first, then wants to import a file - the last directory/folder will be the “open file” directory/folder.
This is what needs to happen:
When the user imports a file, then the next time they import a file they should end up in that same location. regardless of what directory or folder they were previously in. [EDIT] Sorry, that almost doesn’t make sense. I mean “Open File” changes to a set location, but “Import” should always return to the last import location.
I’ve tried creating a variable importedFileCurrentFolder then assigning that to f.NativePath and also f.AbsolutePath thinking that I would get the “path” but I not only get the path but also the filename.
Help appreciated. Cheers.