5 Replies Latest reply on Feb 5, 2013 5:43 PM by taylorsharpe

    How do your remove formatting when pasting, then allow it?

    WBullard

      I want to remove formatting when people past data into a field, but then allow them to later fomat it in that same field.

       

      When I use a calc in the database field options such as RemoveTextFomat(self) and uncheck the "Do not replace existing value of field (if any)", then paste data into a field, the formatting does get removed. Good. The bad news is that I can't format the data in this field after the intial paste.

       

      When I check the "Do not replace existing value of field (if any)" and paste formatted text, the formatting is not removed even when the field is empty when I paste the formatted data. I was hoping it would remove the formating since it was not replacing any existing value, then allow formatting.

       

      What am I doing wrong?

       

      Thanks,
      Will

        • 1. Re: How do your remove formatting when pasting, then allow it?
          Mike_Mitchell

          You're not doing anything "wrong", per se. Except perhaps setting your expectations incorrectly.       

           

          Whenever you set an auto-enter calculation on a field, it will trigger whenever the trigger conditions are met. In the case of the often-useful TextFormatRemove ( Self ), trigger conditions are met whenever the field is modified. So whenever someone changes the data in the field, the auto-enter calculation is triggered.

           

          One way to accomplish what you want would be to teach users to undo Ctrl-Z (Windows) when pasting. This removes formatting. Another method would be to use a Custom Menus to hijack the Paste command, using the Paste script step and choosing the "No style" option. Either way allows subsequent formatting, while simultaneously getting rid of pasted styles.

           

          HTH

           

          Mike

          • 2. Re: How do your remove formatting when pasting, then allow it?
            DrewTenenholz

            Will --

             

            Two ideas:

             

            1) Teach your users to use 'Paste Text Only' using the correct keyboard options (CommandOptionV on Mac).

             

            2) Create a custom menu that swaps and appropriately renames Paste/Paste Text Only with Paste Text Only/Paste With Styles.

             

            -- Drew Tenenholz

            1 of 1 people found this helpful
            • 3. Re: How do your remove formatting when pasting, then allow it?
              taylorsharpe

              This will not solve your problem, but one of the User Interface features of FileMaker is that if you paste into a field something that is formatted, if you immediately type Command-Z (Mac) or Control-Z (Windows), it will remove the formatting but leave what you have pasted in the field.  

               

              You can always have it remove all the formatting and then use the layout field properties to set your formatting options.  That is probably more of what you need to do. 

              1 of 1 people found this helpful
              • 4. Re: How do your remove formatting when pasting, then allow it?
                WBullard

                Not to disparage my users, but remembering a certain keystroke won't go very far with them.

                 

                 

                 


                remove formatting.png

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                Seems like the image above should do what I want it to do. If they paste formated text into an empty field the formatting should be removed. But then they should be able to format the data in the field as they want and the formatting would be retained.

                 

                Taylor - what did you mean when you wrote - "You can always have it remove all the formatting and then use the layout field properties to set your formatting options.  That is probably more of what you need to do. "

                 

                I still get the feeling I'm missing something. What I want to do would seem to be rather basic.

                 

                Thanks your feedback,

                Will

                • 5. Re: How do your remove formatting when pasting, then allow it?
                  taylorsharpe

                  Just set the Auto Enter to "TextFormatRemove" and to replace existing values so that no formatting is stored in the field.  Then in the layout, click on the field and change the field's font, size, color, etc.  That way the layout is controlling how the font looks.  I hope that makes sense. 

                  1 of 1 people found this helpful