Set the initial Directory for open and save

General TRichView support forum. Please post your questions here
Post Reply
dc3_dcfl
Posts: 33
Joined: Sat Jan 30, 2010 12:45 am

Set the initial Directory for open and save

Post 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
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
dc3_dcfl
Posts: 33
Joined: Sat Jan 30, 2010 12:45 am

Post 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...
dc3_dcfl
Posts: 33
Joined: Sat Jan 30, 2010 12:45 am

Post 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 ?
dc3_dcfl
Posts: 33
Joined: Sat Jan 30, 2010 12:45 am

Post 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.
Post Reply