troubleshooting Question

Doc/WillClose command overruled by automatic prompt?

Avatar of Sabina_Compassi
Sabina_CompassiFlag for Switzerland asked on
JavaScriptAdobe Acrobat
1 Comment1 Solution202 ViewsLast Modified:
My Adobe Acrobat documents have a field in which the current date is displayed when opened.
The current date is put into the field by a javascript code as shown below.
The documents are having password security on them, allowing printing and change of forms only (need to allow change of form, otherwise the updating of the current date would not work).

Everything works quite well, but I am unable to suppress the automatic alert "Do you want to save the changes... " when closing the document with Adobe Professional (with the reader it works). I tried to generate a Document even Code (Doc/WillClose), see below, but the code IS NOT SUPPRESSING THE AUTOMATIC ALERT....
Can anyone please help?
Sabina

For the updating the current date in the field: 
{
var f = this.getField("Today");
var d = new Date();
f.value = "Dokument gültig am " + util.printd("ddmmmyyyy", d);
}
 
Code in the Doc/WillClose
{
this.closeDoc(true);
}
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros