Brian Dunning's FileMaker Custom Functions

TextFormatApply ( targetField ; sourceField )

Applies the first available style in "sourceField" to the contents of "targetField"

  Average rating: 4.4 (33 votes) Log in to vote

David Graham   David Graham
Productive Computing, Inc.
http://www.productivecomputing.com/

Share on Facebook Share on Twitter

  Sample input:
TextFormatApply ( targetField ; sourceField )
  Sample output:
targetField will be styled like the first style present in sourceField

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

If you ever wanted to be able to style field text based on the styling present in another field, then this is for you.

Some sample uses:

1. Create user-definable report styles for common page sections (e.g., Title, Subtitle, etc.), and apply to reports dynamically.

2. Style multiple parts of a single document to be the same as another. For instance, if you have separate fields to store a letter body and closing, you can se the style of the closing field equal to the body field.

This CF was inspired by the work of others, but my goal was to create one CF that could do the work of extracting and applying styles without any additional dependencies.

NB, nearly every style variation is supported. I've noticed that it doesn't work with word underline and double underline. You might find some other obscure variations that don't translate.

 

Comments

Bruce Robertson   Bruce Robertson
Feb 5, 2010
All you need is this expression:
substitute( sourceField; sourceField; targetField )
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.