This example will show you how to create a custom macro value that can be used in file names and other PDF settings with support for macros.

The code below shows a VBScript function that returns a string representation of the current time. We will save the function in a vbs file named time.vbs and place it in the macros folder of the PDF Printer. You can find the macros subfolder of the program folder of the PDF Printer.

  1. Rem -- Return the current time in HHMMSS format
  2. Function TimeHHMMSS()
  3.     Dim retv, d
  4.     d = Now
  5.     retv = Right("00" & Hour(d), 2) & Right("00" & Minute(d), 2) & Right("00" & Second(d), 2)
  6.     TimeHHMMSS = retv
  7. End Function

All functions in the macro vbs file can be referenced once the macro file is in place. In case we want to use the new macro in the creation of the PDF output file name then we can open the options dialog and enter string shown below in the file name input field:

<desktop>\<vbs:TimeHHMMSS>.pdf

Download Example Files

You can download and run the example yourself. The files needed are available here. The VBS file must be placed in the macros sub folder of the PDF Printer installation. You can use the MacroDir setting to change the location of the VBS files if needed.

Downloads

Attachment Size
Example file 361 Bytes

Top