September 17, 200421 yr Hello, I have a problem I'm hoping someone has a solution for with FileMaker 6. Essentially I'm trying to implement a mail merge type situation where an editable text field contains tokens/markers that later get replaced with other field values from the database. This editable field contains text of varying styles (some bold, underline, centered, etc.). If I use the Substitute() function: Insert Calculated Result[select, "fTextField", Substitute(GetField("fTextField"), "%TOKEN1%", GetField("fToken1"))"] the markers are replaced as expected BUT I lose all of the styled text. I'm looking for a cross-platform solution (it HAS to run on Mac and Win) that could work in FM 6, with or without plug-ins. I know this all works fine in FM 7 but I'm trying to avoid migrating to FM 7 at the same time unless I have absolutely no other choice. Ideas anyone?
September 18, 200421 yr Get Filemaker 7 and make sure you get the developer version. Then go to the custom functions area here and look at the FieldSubstitute custom function.
September 21, 200421 yr In FM6, if you have to have different parts of the text styled differently, I think you will have to use real merge fields in a text object.
September 21, 200421 yr The Find/Replace function in FMP 6 preserves character formatting. It can be used to merge codes instead of using the Substitute() function. You'll need to copy/paste the template text into a field, then run the Replace script over the text to merge it. Both of these processes are layout dependent (the fields need to be on the current layout when the copy/paste and Replace steps run).
September 21, 200421 yr Author Hi Vaughan, Thanks for the tip. Unfortunately that doesn't get me all the way there as the Copy/Paste script steps blow away the 'centered' formatting on some of the text in the field (the bold, underline, etc. styles come across fine however). The Find/Replace part does work as expected. Oh well. *So* close. I guess it's on to FM 7...
Create an account or sign in to comment