Control Printing Of Shapes Based Od Data Follow
I am evaluating BarTender to see if it can accomplish the following tasks:
- I need to control the printing of an up or down arrow based on the data for the label containing a certain character
- Similarly, I need to control the printing of a left or right arrow based on the numeric portion of the data for the label being odd or even
I've searched the forums and found links to the "Dynamically Changing Objects at Print Time using VB Script" whitepaper. The section on On-the-fly Modification of Object Properties seems to be exactly what I am looking for. It states:
"A common use case for this feature would be to change object’s in response to the data coming from a database. In this case you would write a script for the OnNewRecord event. You could change the color of a text object, depending on whether or not a warning condition was indicated. For example, you could write the following script for the OnNewRecordEvent.
Set Notice = Objects(“Notice Text”)
If (Field(“Condition”) = “Warning”) Then
Notice.TextColor = btColor.Red
Notice.TextColor = btColor.Green
I am using the latest demo in Automation mode. My data source in an Excel spreadsheet with a single column of data called "DATA". My label prints the barcode and text data correctly. The missing piece is the direction of the arrorws.
My OnNewRecord even script is as follows:
'Executes during printing, after reading a database record.
'set object references
Set objUpArrow = Objects("UpArrow")
Set objDownArrow = Objects("DownArrow")
'grab data from data source
strVal = Trim(Field("DATA"))
'set visibility based on data
objUpArrow.PrintVisiblity = Not (InStr(strVal, "A") > 0 )
objDownArrow.PrintVisiblity = (InStr(strVal, "A") > 0 )
When I click the Test button in the Script Assistant, I get the following error:
"The following script error was found: OnNewRecord(Line 11):: Object doesn't support this property or method: "onjUpArrow.PrintVisibility"
Any help would be appreciated. Also, if there is a way to accomplish the above tasks using the Pro version instead of the Automation version, I would also be insterested in finding out how. The labels will only be printed once every 2-3 years on a single PC/Printer by a single user. I would not be getting much value from purchasing the Automation version.
Please sign in to leave a comment.