FileMaker Function of the Week: TextStyleAdd

Stuart Gripman, of FullCityComputing, delves into TextStyleAdd, a function that let’s you apply text formatting via calculations.  I’ve not yet found a use this function as most of the time text is formatted on the layout, but never say never:  The one time you need it, it will be indispensable.  I do see one good use:  If users copy and paste formatted text into a fields and need the formatting stripped (via the function TextFormatRemove), then TextStyleAdd could be used to apply special formatting to the resulting text on the fly.  Another use is to change font styles not provided when applying conditional formatting rules.  Here’s more on TextStyleAdd:

… restrained, judicious application of style can improve the experience and that’s where TextStyleAdd can be of aid.

TextStyleAdd ( Text ; Style(s) )

The first parameter behaves just as you’d expect. It accepts plain text inside quotation marks, a field name, or a variable. That second parameter can only contain combinations of the 17 pre-defined styles.

TextStyleAdd ( “chicken musket” ; Bold ) will return “chicken musket“.

You may combine styles by placing a plus sign between them. To wit:

TextStyleAdd ( “Wednesday Everyday!” ; Bold+Strikethrough ) will return “Wednesday Everyday!“.

Read the whole article to see the styles you can select, and to learn the limitation of the command when formatting it in a script.

FileMaker Function of the Week: TextStyleAdd.

Reminder:  FileMakerProGurus is an Amazon Affiliate.  By clicking the ad below and then making you purchases, you will not be charged more, but we will get a small percentage of the sale from Amazon. Making it easier to keep this website going. Thanks for your help.

Liked Liked
Need FileMaker Development Help? Or to purchase FileMaker Software?
Contact FM Pro Gurus for help