Using VBScript as a Data Source Type

Text, encoder, and barcode objects on a template can receive their data from a number of sources, including your keyboard, database or text files, and your computer's time and date functions. Sometimes, however, you may have special requirements, such as a need to read data from a file, process it, change it in a particular way, and then perhaps combine it with some other data. By using Microsoft Visual Basic Script (VBScript) as a data source type, you can process and combine the data for objects on a template in almost any way you want.

ClosedTo set a data source's type to VBScript

  1. Add a text, encoder, or barcode object to your template.

  2. Double-click the border of the object to open that object's Properties dialog. Alternatively, right-click the object, and then click Properties.

  3. In the navigation pane, select the data source whose type you want to change.

  4. Click the Data Source tab.

  5. Click at the right of the Type field to start the Change Data Source Type wizard.

  6. In the Type list, click Visual Basic Script.

  7. Click Finish.

  8. Select the Script Type that you want.

You can enter your script directly into the text field. To use the advanced scripting functions of the Script Editor, click Edit with Script Editor.

To make Visual Basic Scripting accessible to more than programmers, BarTender provides three levels of complexity for Visual Basic Script users who want to use VBScript as a data source type.

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 events), BarTender returns an error, and your script does not run.

In This Section