Skip to main content

Search

Search

vbscripting, random numbers

Comments

4 comments

  • Avatar
    Peter Thane

    Add a sequential number field off to the side of the label (ie so it doesn't print) and configure your VB Script as an Event Controlled Script set to OnSerialise

    0
  • Avatar
    Ashish Karnani

    Hi Peter - I added a sequential number field (and I could actually use that sequential number in place of the 6 digit random number).  

    How do I chance the VB Script from "OnProcessData" to "OnSerialize" ?

     

    0
  • Avatar
    Ashish Karnani

    I did try setting a vbscript in the Document Events' OnSerialize to concatenate the existing value with the 6-digit serial number

    Bar Code 2 is the item i'm trying to add the 6-digit serial number (or random number) to and Text 13 is the newly created serialized item which is off the label. 

    Format.Objects("Bar Code 2").Value = Format.Objects("Bar Code 2").Value & Format.Objects("Text 13").Value

    The error I get is :   OnSerialize: Unable to write read-only property.   How woudl I make "Bar Code 2".Value but updatable, i.e. not read only?

    0
  • Avatar
    Peter Thane

    You need to make the field itself an Event Controlled VB script routine rather than use a Document Level Script

     

    As in the image above the Text element could be added as a separate substring to the VB element 

     

     

    0

Please sign in to leave a comment.