How to define defaul File name and path before SaveAs action

General TRichView support forum. Please post your questions here
Post Reply
max.beliy
Posts: 26
Joined: Tue Jul 12, 2016 11:35 pm

How to define defaul File name and path before SaveAs action

Post by max.beliy »

How I can define default file name and path for showing them in
rvActionSaveAs dialog ?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

RVAControlPanel.DefaultFileName
If you want to change the default format as well, assign also DefaultExt and DefaultFileFormat properties
max.beliy
Posts: 26
Joined: Tue Jul 12, 2016 11:35 pm

Post by max.beliy »

It works only once at design time, but in run time changing of
RVAControlPanel.DefaultFileName doesn't work, and the file name is still same as set in design time.
max.beliy
Posts: 26
Joined: Tue Jul 12, 2016 11:35 pm

Post by max.beliy »

TrvaDocumentInfo(rvActionSave1.Documents[rvActionSave1.FindDoc(RichViewEdit1)]).FileName := ...
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

This property is applied every time you call RvActionNew.Execute.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Yes, if you need changing file name AFTER its assigning, you can change
rvActionSave1.GetDoc(RichViewEdit1).FileName.
It works both for default file name (assigned by New) and for exact file name (assigned by Open or SaveAs).
Post Reply