Colour Code
Hi,
I did spend last couple days trying find out the possibility to colour code the box shape based on data in excel.
Is there any possibility to colour code shape based on number or words, if not what else i can use to make it happen?
Thanks,
Josh
-
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:
0 -
Legacy Poster
★ BarTender Hero ★
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 -
Fernando Ramos Miracle
★ BarTender Hero ★
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
请先登录再写评论。
评论
3 条评论