I've been trying to stop the closing of a document in OnEvent but I've been unable to actually cancel the close of a document.
The line I'm using is:
Call tPdf1.DoVerb("Notifications.BeforeSaveDoc.Cancel", "Set", 1, Nothing)
which is only being run when the "Notifications.BeforeCloseDoc" event is fired, and if I check the property before and after that set line it does in fact change, but the document still closes.
Any assistance would be appreciated.
BeforeSaveDoc.Cancel
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: BeforeSaveDoc.Cancel
Hi, docu-track99.
To skip closing of document:
Check your code again...
Best
Regards.
To skip closing of document:
Code: Select all
eventhandler OnEvent(type, name, ...)
{
if (type==PXCVA_OnNamedNotify AND name=="Notifications.BeforeCloseDoc")
{
tPdf1.SetProperty("Notifications.BeforeCloseDoc.Cancel", 1, 0);
}
}
Best
Regards.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 518
- Joined: Thu Dec 06, 2007 8:13 pm
Re: BeforeSaveDoc.Cancel
Hmmm, interesting.
The only difference between our two lines of code is the "Call" statement at the start of the line. (Your line does work, while mine doesn't, this is all in VB6.)
Most of your example lines follow the "Call *control*.SetProperty(*Stuff*)", so that's the format that we've been following. I'm pretty sure this is the first instance where we've had to drop the "Call" statement. I'm not sure if that means there's something different between the different underlying things to cause this difference in behaviour...
Anyways, thanks for the help!
The only difference between our two lines of code is the "Call" statement at the start of the line. (Your line does work, while mine doesn't, this is all in VB6.)
Most of your example lines follow the "Call *control*.SetProperty(*Stuff*)", so that's the format that we've been following. I'm pretty sure this is the first instance where we've had to drop the "Call" statement. I'm not sure if that means there's something different between the different underlying things to cause this difference in behaviour...
Anyways, thanks for the help!
-
- Site Admin
- Posts: 7362
- Joined: Wed Mar 25, 2009 10:37 pm
Re: BeforeSaveDoc.Cancel
make sure to let us know if you need anythign further. 

Best regards
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: BeforeSaveDoc.Cancel
Look to your code:
Call tPdf1.DoVerb("Notifications.BeforeSaveDoc.Cancel", "Set", 1, Nothing)
- but your "Notifications.BeforeSaveDoc" is NOT EQUAL to "Notifications.BeforeCloseDoc" correct name !
HTH.
Call tPdf1.DoVerb("Notifications.BeforeSaveDoc.Cancel", "Set", 1, Nothing)
- but your "Notifications.BeforeSaveDoc" is NOT EQUAL to "Notifications.BeforeCloseDoc" correct name !
HTH.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 518
- Joined: Thu Dec 06, 2007 8:13 pm
Re: BeforeSaveDoc.Cancel
How did I miss that?
Especially since I know I didn't copy them in from somewhere, but would have typed them in...
Oh well, good to know it was just operator error rather than anything weird or "unexplainable" in the code/control.
Especially since I know I didn't copy them in from somewhere, but would have typed them in...
Oh well, good to know it was just operator error rather than anything weird or "unexplainable" in the code/control.
-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am