Document-Level Events

BarTender supports the running of Visual Basic Script (VBScript) in response to a variety of document-level events, including open, close, save, and a number of print-time events. You can call the Object Automation functions from within this VBScript to modify an object on your template before and during print jobs.

ClosedTo enable VBScripting for document-level events

  1. On the BarTender File menu, click BarTender Document Options to open the BarTender Document Options dialog.

  2. Click the Scripting tab.

  3. Click to select the Enable document level script events check box.

  4. Select the event that you want to edit, and then click Edit to open the Script Editor.

If the Script Editor is already open, you can modify a document-level event by selecting it in the Script pane.

BarTender does not support automation for data entry controls. If you try to use an Object property in a data entry script (such as the OnPrePrompt or OnPostPrompt event), BarTender returns an error, and your script does not run.

Available Document Event Scripts

All of the available document event scripts are listed under Document Events in the Script pane. When you select an event and then create a script in the Editor pane, the script runs when the event occurs. For example, if you select OnOpen and then write a script for it, that script runs when the document is opened.

BarTender supports the following document events:

Although Procedures for Document Events appears in the Script pane under Document Events, it is not really an event at all. This item is a collection of VBScript functions and subroutines that you write, which can be used by the scripts that you create for genuine document events. For more information, refer to Procedures.