I found this script in experts exchange to put the print date on a document but it is a very manual process.
Is there a way to have the button object created automatically and the javascript assigned by a menu option?
Comment from AnnaNmty
Date: 12/11/2002 01:00PM PST
Comment
This process worked fine in my test:
1. Create a button object in your SOPs and call it "date" (no quotes)
2. In Tools, JavaScript, Set Document Actions, Document Will Print, Edit paste
/* Create a date object containing the current date. */
var d1 = new Date();
/* num contains the numeric representation of the current date. */
var num = d1.valueOf();
var f = this.getField("date");
f.buttonSetCaption("This printed copy expires two weeks after " + util.printd("mm/dd/yyyy", d1));
3. In Tools, JavaScript, Set Document Actions, Document Did Print, Edit paste
var f = this.getField("date");
f.buttonSetCaption("");
Would you like me to post how to create a button?
There is also a way to add fields programmatically, but I was not sure if that is something you would be interested in. Each SOP would have to have the same format because the field is put in a specific location. Let me know.
Is there a way to have the button object created automatically and the javascript assigned by a menu option?
Comment from AnnaNmty
Date: 12/11/2002 01:00PM PST
Comment
This process worked fine in my test:
1. Create a button object in your SOPs and call it "date" (no quotes)
2. In Tools, JavaScript, Set Document Actions, Document Will Print, Edit paste
/* Create a date object containing the current date. */
var d1 = new Date();
/* num contains the numeric representation of the current date. */
var num = d1.valueOf();
var f = this.getField("date");
f.buttonSetCaption("This printed copy expires two weeks after " + util.printd("mm/dd/yyyy", d1));
3. In Tools, JavaScript, Set Document Actions, Document Did Print, Edit paste
var f = this.getField("date");
f.buttonSetCaption("");
Would you like me to post how to create a button?
There is also a way to add fields programmatically, but I was not sure if that is something you would be interested in. Each SOP would have to have the same format because the field is put in a specific location. Let me know.