watermark <date> DDMMYYYY

About the programming interface for the virtual PDF printer driver.

Moderator: jr

watermark <date> DDMMYYYY

Postby icecurtain » Thu Feb 09, 2012 12:55 pm

The current BASE.VBS macro to create the watermark <date> is shown below can I tweak it to get DDMMYYYY? if I can what changes do I need to do?

Rem -- Debugging
Dim context
Set context = CreateObject("Scripting.Dictionary")
wscript.echo DateYYYYMMDD()
wscript.echo FileCounter()

Rem -- MACRO REGION BEGINS

Rem -- Return the current date in YYYYMMDD format
Function DateYYYYMMDD()
Dim retv, d

d = Now
retv = Right("0000" & Year(d), 4) & Right("00" & Month(d), 2) & Right("00" & Day(d), 2)
DateYYYYMMDD = retv
End Function
icecurtain
 
Posts: 1
Joined: Thu Feb 09, 2012 12:49 pm

Re: watermark <date> DDMMYYYY

Postby admin » Sat Feb 11, 2012 6:08 pm

You can create a new macro:

Function DateDDMMYYYY()
Dim retv, d

d = Now
retv = Right("00" & Day(d), 2) & Right("00" & Month(d), 2) & Right("0000" & Year(d), 4)
DateDDMMYYYY = retv
End Function

Save the macro above in a .vbs file in the macros folder and use the following in your output specification <vbs:DateDDMMYYYY>

That should do the trick :-)
admin
 
Posts: 58
Joined: Fri Oct 28, 2011 8:09 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 4 guests

cron