Page 1 of 1

Set the initial Directory for open and save

Posted: Wed May 05, 2010 2:45 pm
by dc3_dcfl
I am using rvActionInsertFile and rvActionExport and want to set the initial directory for the open and save operations.

I attempt to set the initialdir property but I get a compile time error telling me that "property 'InitialDir' inaccessible here'

I am attempting to set these properties in the formcreate method.

Where and how do I set the initialdir property for both these actions?

Thanks in advance

Posted: Wed May 05, 2010 4:16 pm
by Sergey Tkachenko
How do you assign InitialDir property?
Both actions have this property, it is published and can be changed even in the Object Inspector.

Posted: Wed May 05, 2010 4:50 pm
by dc3_dcfl
As soon as you mentioned that I can change it in the Object Inspector, I figured out what I was doing wrong.

Thanks...

Posted: Wed May 05, 2010 5:48 pm
by dc3_dcfl
If I could, follow up with another question.

I set the initial directory with:

rvActionInsertFile1.initialdir := GetSpecialFolderPath(CSIDL_PERSONAL);

This is executed once in the formcreate method.

Also, GetSpecialFolderPath is a function I declare and seems to work fine for all my other savedialogs in my application.

My new problem is if I navigate away from the path set up as above, any subsequent time I reexecute the action, the dialog opens up in the last directory I was in, not the initial directory I have set. Even if I close the form and reopen, it still opens in the last directory, and even when I terminate the application and relaunch, it goes back to the last directory, rather than the initialdir? Nothing I do seems to reset the initial directory other than navigating to a new directory and open or export a document.

How do I ensure that every time this action is executed, it opens up in initialdir ?

Posted: Wed May 05, 2010 6:13 pm
by dc3_dcfl
OK seemed to have solved this one. I was setting the filename for the rvActionExport1. Saw from another post that if the filename was set, the initial directory was set differently.

I removed the part that set the file name, now my initial directories are persistent.