Zum Hauptinhalt gehen

Suche

Suche

Colour Code

Kommentare

3 Kommentare

  • Avatar
    Domingo Rodriguez
    Moderator

    You can do this inside the BarTender document by making use of some document level based VBScript (only available in Automation Editions of BarTender). This VBScript can be found under BarTender's "File > BarTender Document Options" dialog and now accessing the "VBScripting" tab.

     

    You can find a full reference on this under BarTender's Help (F1 key) and now by visiting the "Visual Basic Scripting > Scripting Objects > Object Reference > Object object" topic. FillColor and LineColor property are the ones you need to look at.

     

    Furthermore, some more help can be found on the following White Paper:

    http://www.seagullscientific.com/label-software/whitepapers/dynamically-changing-objects-at-print-time-using-vb-script.pdf

    0
  • Avatar
    Legacy Poster

    Thank you very much for your help, i did managed get the new sample working but i'm struggling with my old label. 

     

    ColourBox - object name 

    Col alias to field in excel file called Colour 

    In excel file colour is saved as hexadecimal format.  

     

    I'm getting error message after i'm trying print label... 

    Error Message #3904 

     

    OneNewRecord Type mismatch: 'Clng' 

     

    When i change "Field("Col")" to "&HFFFF0000" everything is working fine. (all the fields in excel for colour are with "&HFFFF0000") 

     

    Currently VBA code is setup as bellow: 

     

    ReferenceField("MDA$.Col")
    Format.Objects("ColourBox").FillColor = Clng(Field("Col"))
    

     

    Thank you. 
     
    Josh, 
     
    0
  • Avatar
    Fernando Ramos Miracle
    Moderator

    Could you clarify exactly when are you getting this error message?

     

    If it's when entering the code this is expected, note that at design time the database field reference will have a default value which probably has nothing to do with the actual contents of the database.

     

    If you ignore the error and test printing, do you still get this error message?

     

    *If you wish to prevent this design time error you can always specify the default value for the field reference, for example: Field("Col","&HFFFF0000")

     

    Regards

    -1

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.