Page 1 of 1

Is first save?

Posted: Wed Mar 05, 2014 6:11 pm
by starhu
Hello,

I need to log the save of the file only if it is the first save or save as.

- So the user creates a new document and save it -> I need to log it
- The user types in something and saves it -> I don't need to do anything
- The users clicks on Save As -> I need to log it

The problem is that in the rvActionSave1Saving method I cannot distinguish if it't the first save or not.

I tried comparing

srvActionsResource.rvActionSave1.GetDoc(MainForm.ActiveEditor.RichViewEdit).FileName and the input FileName because I though that srvActionsResource.rvActionSave1.GetDoc(MainForm.ActiveEditor.RichViewEdit).FileName would be the old file name but they are the same.

Thank you

Posted: Wed Mar 05, 2014 7:03 pm
by Sergey Tkachenko
Use TrvActionSave.OnDocumentFileChange event

Posted: Wed Mar 05, 2014 7:57 pm
by starhu
Hello,

Thank you, I tried it, but it never enters into OnDocumentFileChange event, no matter if I save, edit or close.

Posted: Wed Mar 05, 2014 8:29 pm
by Sergey Tkachenko
This event is already assigned in code of ActionTest demos.
It is assigned in FormCreate, and probably this assignment overrides yours.

In ActionTestTabs it is used to display a file name on a tab.

Posted: Thu Mar 06, 2014 11:19 am
by starhu
Thank you, it works now.