On 02/02/2011, at 11:35 AM, Michael Cindric wrote:

> Have a requirement where we need to design a doc using word templates
> dot files or even word docs docx files and then mail merge the data in
> using place holders e.g {{first_name}},
> 
> Now word templates are now just really zip files but having no end of
> issues when l try to unzip merge in data and then re-zip so it can be
> opened again in word.
> 
> Think it has to do with the type of compression

Having done this before with Excel reports a while back, it's less likely to be 
the compression (as long as it's a zip) than issues with the XML itself.

It's hard to debug since Word won't give you any decent error messages. Here's 
a couple of things to try:

1) Before zipping it up check the post-merge XML and make sure you're not 
breaking anything.

2) Test your process with one record before throwing all your data at it. It 
might be odd characters in your data.

3) Make the change manually in Word and see what changes and make sure you're 
doing the same change when merging 

In summary, any invalid XML will break the document, so make sure that isn't 
the issue.

Cheers,
Josh

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to