Thanks Jan I was actually doing this in a sort of dynamic way looping through fields in the stack to make the variables on the fly, and hence not declared them. As soon as I added a line:
do "local" && tMergeFieldName it started working well. I obviously wasn't doing something right because having revisited my code anyway to make the variables with : do "put field" && tField && "of card" && tCard && "of this stack into" && tMergeFieldName it works, even without pre-declaring the variable. If the field is empty, then the variable is created with the content empty as well. So this is much appreciated. I don't suppose there is any way to have the merge operation delete any undeclared placeholders though is there? If I have a generic template document that may have (for example) 3 sections, but only 2 sections declared in the dynamic generation, is there a method for having the output document drop the unused placeholders? Some jiggery-pokery with regex before output I suppose? -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p3317365.html Sent from the Revolution - User mailing list archive at Nabble.com. _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode