Vb Script To Print Labels In Increments Or Decriments At Value Inputted At Prompt Dialog Follow

0
Avatar
Legacy Poster

Hello Experts

I am fairly new to VB scripting

I need a label that asks for an starting number from the user and the number it needs to increment or decrement by

 

E.g.:

Prompt to enter starting number: 1or 001 or 004 so on

Prompt to enter the value to increment or decrement by: 1 or 2 or 3 so on

 

I have been able to create a prompt to ask for the starting number

I am at the moment manually serializing it in Serialization TAB in More Data Source Option

 

It would be a big help if there was a VB script to change inputs 

 

I am using Bartender v9.4 SR3

 

Thanks and Regards

Rahul

 

 

 

 

 

 

5 comments

0
Avatar
Ian Cummings
Moderator
Comment actions Permalink

Find attached an old example of a BarTender document file that does the serial number range this you're requesting.  I hope it helps.

0
Avatar
Legacy Poster
Comment actions Permalink

Hi Ian

Thanks for replying

 

I have attached my btw file so you can have a look

 

What I have setup is the user inputs the start of the serialised number

The user select the no of serialised labels when printing

 

Sometimes we need the label to incremented. Say for example by 3

 

So if the user inputs starting number as 001 and during printing selects number of serialised labels as 5

Bartender prints 5 labels as below

Label 1 - 001

Label 2 - 004

Label 3 - 007

Label 4 - 010

Label 5 - 013

 

At the moment if we need the labels to be incremented by 4, I have to go and change it to 4 in the Serialization Tab in More Data Source Options

Then it prints in increments of 4

 

My question is it possible to be able to change the increment value at the prompt stage

If the labels need to be increment by 2 the user inputs 2 and labels print with that value

 

That way I don't need to go and modify the label every time we need to increment at a different value

 

Thanks and Regards

Rahul

 

0
Avatar
Ian Cummings
Moderator
Comment actions Permalink

In BarTender v10.1 this is easy as you can specify a data source value, which you can make a user prompted item, for both the increment amount and the increment interval.  See the attached image.  To do this in your current version you'd need to not use the BarTender serialization feature at all, and instead implement an event based VB script to handle the serialization of the labels.

0
Avatar
Legacy Poster
Comment actions Permalink

Hi Ian
Would you be able to guide me on implementing an event based VB script?
I haven't done it before, but would love to try
Would you have some examples that I can refer too & copy

Thanks & Regards
Rahul
1
Avatar
Ian Cummings
Moderator
Comment actions Permalink

Sorry, but my recommendation would be to get a newer version of BarTender.

 

In the VB scripts you set the value of the data source by way of the expression: value = X

 

Use a variable to keep the running value of the serial number, and using the "OnIdenticalCopies" event you'd increment the serial value with a X = X +1 or perhaps with  X = X + Format.NamedSubStrings("BTIncrementAmount").Value

Please sign in to leave a comment.