sp_send_dbmail and mail merge documents

I am using the sp_send_dbmail stored procedure to create my emails from SQL.  I know have  a requirement to send out merge documents that have been created and used in the past.  Now they want me to try and create the mail merge word docs and send them out as attachments with my emails which are created from sp_send_dbmail.  Any ideas on the best method?
Who is Participating?
Mark WillsConnect With a Mentor Topic AdvisorCommented:
Well, it is actually word that does the mail merge piece so think you are really going to struggle to get word to merge individual documents to pass back to you so you can mail them out.

You can create various objects to invoke the mail merge and you could control that from SQL, but combining them with your existing emails is again, very difficult.

I am currently scratching my head trying to think if it is even possible. At this point I am inclined to think it is not possible to do it the way you are asking.

Essentially, you have to create the document, and then tell dbmail what (and where) the attachment is...

Have a look at http://support.microsoft.com/default.aspx?scid=kb;EN-US;q285176 and http://support.microsoft.com/kb/258512/ as a couple of ideas. Each time you will notice that word is really controlling it.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.