watermark <date> DDMMYYYY

About the programming interface for the virtual PDF printer driver.

Moderator: jr

icecurtain
Posts: 1
Joined: Thu Feb 09, 2012 12:49 pm

watermark <date> DDMMYYYY

Post by icecurtain »

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
admin
Posts: 77
Joined: Fri Oct 28, 2011 8:09 pm

Re: watermark <date> DDMMYYYY

Post by admin »

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 :-)
Post Reply