sablon icon indicating copy to clipboard operation
sablon copied to clipboard

Insert new mail merge fields using sablon

Open coezbek opened this issue 3 years ago • 2 comments

Is there a way to let Sablon insert mail merge fields into the word template?

This would be helpful to build the template in the first place.

I imagine the following workflow:

  • Build context object in Ruby
  • Create the template with a merge field called something like allFields
  • Run Sablon once to have it generate new merge fields for the whole context and insert them in the position of allFields.

coezbek avatar Sep 30 '21 06:09 coezbek

Hey @coezbek the word templates are finicky at times since docx files aren’t really designed in a friendly way to interact with outside of MS word itself.

That being said I’m not quite sure I understand. Are you meaning to insert the all the fields in the doc so that one could copy and paste them around?

stadelmanma avatar Sep 30 '21 15:09 stadelmanma

Yes, I meant to insert all entries from the context as fields into an intermediate template to then move them around to produce a final template.

On Thu, 30 Sep 2021, 17:04 Matthew Stadelman, @.***> wrote:

Hey @coezbek https://github.com/coezbek the word templates are finicky at times since docx files aren’t really designed in a friendly way to interact with outside of MS word itself.

That being said I’m not quite sure I understand. Are you meaning to insert the all the fields in the doc so that one could copy and paste them around?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/senny/sablon/issues/175#issuecomment-931406302, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC4Q2TZPGVZRCMSZXQZ6JMLUER4AVANCNFSM5FBQUWPQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

coezbek avatar Sep 30 '21 15:09 coezbek