Page 1 of 1

How to detect between Save and Save AS

Posted: Fri May 20, 2016 8:43 pm
by docu-track99
I would like to detect if user does Save or Save As.

I have implemented ON Event for pdfCtrl. See below.

Private Sub PdfCtrl_OnEvent(ByVal sender As Object, ByVal e As AxPDFXEdit._IPXV_ControlEvents_OnEventEvent) Handles pdfCtrl.OnEvent

My issue is, regardless what user clicks (Save or Save AS) it generates e.nEventID same (2264 gets genereted bor both Save and Save As). I would like to execute different code when doing Save As. Is there a programmatic way to detect which button has been pressed?

Re: How to detect between Save and Save AS

Posted: Mon May 23, 2016 8:02 am
by Sasha - Tracker Dev Team
Hello docu-track99,

The best way would be to handle the command execution itself by implementing a custom command handler - there you will now the command ID that was executed:
https://gist.github.com/Polaringu/ad31ad433401c1c004d0

Cheers,
Alex

Re: How to detect between Save and Save AS

Posted: Wed May 25, 2016 6:21 pm
by docu-track99
Hello docu-track99,

The best way would be to handle the command execution itself by implementing a custom command handler - there you will now the command ID that was executed:
https://gist.github.com/Polaringu/ad31ad433401c1c004d0

Cheers,
Alex

Re: How to detect between Save and Save AS

Posted: Wed May 25, 2016 6:22 pm
by docu-track99
Hello Alex,

The link you gave me has code for OpenFileDialog, I still need tracker's code to implement FileSave in my customizeSaveCommandToolStripMenuItem.click.

Thanks,

Re: How to detect between Save and Save AS

Posted: Thu May 26, 2016 7:09 am
by Sasha - Tracker Dev Team
The link I gave illustrates how to implement an overall custom command handler. The open command was given earlier to someone as an example. You'll need to implement something like that for save command. This will allow you to monitor when the command was executed.
One more thing - you will need a listener handler, meaning that you'll need to redirect all of the methods to previous handler. That all would look like this:
https://gist.github.com/Polaringu/16bb2 ... 7cbe36f4e6

Cheers,
Alex