Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I Put Print Date on multiple documents

Status
Not open for further replies.

rphbrew

Technical User
Nov 30, 2002
40
US
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.

 
Wow, it looks like a gang of you asking the same question...
happy.gif


Marcus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top