Object error when dynamically changing font color in script.
I am having problems with a VB script that I am using to change the color the text for an items on my label. I have the below script entered in the VB Scripting section of Transformations. When I test the Script I get an error “<Line 7: : Type mismatch: 'Objects'>.
Could use some pointers on what I am doing wrong.
Thanks
ReferenceField ("WP066009.PFPTXT")
Set Pallet = Objects("Text 10")
If (Field("WP066009.PFPTXT") = "PARTIAL PALLET") Then
Pallet.TextColor = btColor.Black
Pallet.TextBackgroundColor = btColor.White
Else
Pallet.TextColor = btColor.White
Pallet.TextBackgroundColor = btColor.Black
End If
-
KM3
★ BarTender Hero ★
I don't think using a class object like this works... Idk, could be wrong. But I'm pretty sure you can't manipulate objects (layout elements) in the OnProcessData event. Go to File > Document Options > VBScript (off the top of my head). Enter the script there. To reference your "Text 10" element, simply write Format.Objects("Text 10").TextColor = btColor.White. Or similar. Shouldn't be too hard to figure out.
0 -
Todd Hansen
★ BarTender Hero ★
That got it working.
Thanks
0
Iniciar sesión para dejar un comentario.
Comentarios
2 comentarios