Skip to main content

Search

Search

Hide 'serial Number' Title On Label

Comments

6 comments

  • Avatar
    Ian Cummings
    Moderator

    Yes you can do this via a label Format level VB script.

     

    Select the "File>BarTender Format Options" menu item, select the "VB Scripting" tab, and enter in something like the following:

    If Format.Objects("Text 1").Value = "Yes" Then
    	Format.Objects("Box 1").PrintVisibility = True
    Else
    	Format.Objects("Box 1").PrintVisibility = False
    End If
    

     

    Note that in this example "Text 1" is the name of the text object whose value it is I wish to test, and "Box 1" is the name of the box object that I wish to conditionally print or not based on the value found.

     

    See the below white paper for more information on this topic:

     

    http://www.bartenderbarcodesoftware.com/label-software/whitepapers/Dynamically-Changing-Objects-At-Print-Time-Using-VB-Script.pdf

    0
  • Avatar
    Legacy Poster

    Thank you very much for reply!!

     

    Unfortunately,  "Box1" is not an object( I wish, it is :(  ) it's already printed in the label. That's a pain.

     

    SERIAL NUMBER :

     

    I thought I could  to create VbScript function to draw a filled frame around this title on base of condional. Let's say something:

     

    OnPrintJobStart event:

     

    Dim myStr, ret


    myStr = Objects ("Item"). value.....(Item="INT-WX350)
     

    ret = Mid(myStr,1,3)

     

    If ret = "INT" Then

    Dim arectangle

    Set arectangle = New Rectangle

    arectangle.init 10, 20, 15, 15(coordinates of the title(SN)

    arectangle.setWidth 30

    arectangle.draw

    End If

    (function needs to be create as well)

     

    Just my thoughts.....

    Any input :) ?

    0
  • Avatar
    Ian Cummings
    Moderator

    We are talking about objects that you have created on your BarTender label document?

     

    My example assumed that a box object was already created on the label and that it was named "Box 1".  It could be named whatever you like.  The point is that you can use the VB script to print or not print it based on the value of another object, or even a single data source.

     

    Isn't that what you wanted?

    0
  • Avatar
    Legacy Poster

    Hello,

     

    I'm trying to make an object printable or not, depending the value of a column in my database (Excel).

    I've tried the following code OnPrintJobStart, but it doesn't work :

    If Field("'#$'.CE")="N" Then
        Format.Objects("Texte 2").PrintVisibility = False
    Else
        Format.Objects("Texte 2").PrintVisibility = True
    End If 
    

     

    Do you have any idea of what to do ?

    0
  • Avatar
    Ian Cummings
    Moderator

    Wouldn't the OnNewRecord event be more suitable.  By the way, is '#$' really the name of your worksheet?  Normally a field reference would look like this: Field("Sheet1$.FieldName")

    0
  • Avatar
    Legacy Poster

    Ok, I've tried OnNewRecord event, it works well !!

    Thanks a lot !

     

    My datasheet was called '#', I rename it.

    0

Please sign in to leave a comment.