How to mark allergens in Uppercase with VBScript Follow

Laura Vela

BarTender Content Team


 Is it possible to mark up the allergens using uppercase?



As uppercase it is not a "predefined" format in our sample EU FIC Allergen Label, we need first to include additional tags that will help us use the desired format, in this case uppercase.

To do that, open the Ingredients' properties (the markup language text properties dialog) and click on the VB script object.

We click on the "Edit with the Script Editor..." button to modify the script more easily and add the following code on the "highlighting" section (after all the row of IF/END IF elements at the beginning):

If (AllergenStyle = "Uppercase") Then
   tagStart = "<span style='text-transform:uppercase'>"
   tagEnd = "</span>"
End If


This will allow us to use the tags (<span style='text-transform:uppercase'>) whenever an allergen is detected as long as we define our AllergenStyle as "Uppercase" (which is the name we have designated for those tags with our code).

To select the AllergenStyle, we just go to the AllergenStyle Named Data Source and change the Embedded Data to "Uppercase":

Do you have feedback or questions on this article? We encourage you to post them on our Community Forums