Referencing Named Data Sources

When you name a data source in an object on a template, you are able to access the data contained within that data source and 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 specified in your document.

When using named data sources in scripts, it is recommended that you follow the naming restrictions defined in Visual Basic. Avoid beginning data source names with numbers, or using spaces and special characters in the data source name. If you do not follow these conventions, you will need to reference the desired data source using one of the methods below.

ClosedTo reference a named data source in your script

Choose one of the following methods:

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

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

Related Topics