2 Replies Latest reply on Oct 31, 2012 10:50 AM by jmcroteau

    TextFormatRemove VS Ctrl+Shift+V



      TextFormatRemove VS Ctrl+Shift+V


           Recently upgraded from FM Pro 9 to FM Pro 12V2

           Users filling in text data fileds often copy/paste text from other sources. In the older FM version, text formats were automatically removed and replaced by the layout field formats. In the new version, formats are kept with the pasted text. The only two workarounds I know of are either apply to all the required fields a calculated value "TextFormatRemove" or have users paste text using the Ctrl+Shift+V command. Either we modify the fields definitions or teach a new trick to all our users... For consistency, the 1st option is preferred.

           Since our database holds about 30 tables and each of them have from 10 to 50 user editable text fields and not having the time and resources required to modify each of them individually, I am wondering if there is a simpler/faster way? One that, for example, could be applied to multiple fileds at once, via the layout mode?



           PS By mistake, I found that pasting with Ctrl-V followed by Ctrl-X also removes text formats.


        • 1. Re: TextFormatRemove VS Ctrl+Shift+V

               Best method I know of is

               TextFormatRemove ( Self )

               By using "self", you have a single expression you can now copy and paste into the auto-enter calculation of each of your fields.

               But keep in mind that there is one key distinction between ctrl-shift-V and the auto enter calculation. With the auto-enter calc, it is impossible for the user to ever apply text formats to the text in the field--whether by using the tools in the formatting tool bar or by pasting formatted text. With the keyboard shortcut, you give the users an option to paste with or without the formatting.

               Hmmm, now that I think about this, you could set a script to run from an OnRecordCommit trigger that used go to next field to loop through all the fields in your layout's tab order and use set field by Name to strip out the text formatting. That might be less work for you the developer than setting this up on each individual field, but also might have create a small delay each time the record is committed.

          • 2. Re: TextFormatRemove VS Ctrl+Shift+V

                 Most of our layouts are used for printing, so complete control over text format is required.

                 I will look into the trigger but before, I will have to catch up on FileMaker changes: I introduced FM to our company back when V4 was out (1998) and haven't been involved since then...

                 Thanks for the tip!