Views:

Product: LABELVIEW, CODESOFT

Version: LABELVIEW Gold and Any version of CODESOFT 2014 and Newer

 

First create your Counter (in this example it will be labeled Counter1) and have the variable you want to set the Maximum value of the Counter to (in this example, it will be a When Printed field named WhenPrinted1).

1. Go to File > Properties > Visual Basic Scripting.

2. Check the checkbox to Activate event call and select Sub OnBeforePrintJob.

3. Enter the following into the large box:

Document.Variables.Item("Counter1").MaxValue = document.Variables.Item("WhenPrinted1").Value()

4. Click OK.

NOTE: If using CODESOFT Pro, instead of going to File > Properties, you will want to go to the properties of a text object on your label, then go to Visual Basic Scripting.