Referencing Named Data Sources

When you name a data source in an object on a template, you can access the data that is contained in that data source and then use it in other objects. In addition to sharing data between objects, you can reference the named data source in a Visual Basic Script, so that the application returns the value of the specified data source. The Script Assistant pane of the Script Editor contains a list of all of the named data sources that are specified in your document.

When you use named data sources in scripts, we recommend that you follow the naming restrictions that are defined in Visual Basic. Avoid starting data source names with numbers or using spaces and special characters in the data source name. If you do not follow these conventions, you must reference the data source by using one of the following methods.

ClosedTo reference a named data source in your script

Use one of the following methods:

The Named Data Sources book does not appear in the Script Assistant pane unless you linked an object from the current template to a named data source.

When you reference named data sources with conditional statements, BarTender might not identify all data sources that are used in your script. If your script does not run as expected, you might need to "force reference" the data source. For more information, refer to Forcing References.

Related Topics