March 15, 2007 at 7:26 am
Is there a way to link SQL results directly into word?
Maybe using VBA or suchlike?
March 15, 2007 at 10:07 am
Dion
I haven't read through this, but it may have what you want.
http://www.simple-talk.com/sql/t-sql-programming/writing-to-word-from-sql-server/
John
March 15, 2007 at 10:29 am
Nearly...
that's using a SP to push into a word doc table.
All I want to do is build a case statement within a word doc based upon the results of an SQL statement...
March 16, 2007 at 11:55 am
I assume you're referring to more that just a mail merge data set.
If you know how to code in VBA, then Open your Word doc, hit Alt+F11 to open the VB Editor, add a Module, and create a Subroutine that uses ADO to attach to and execute your SQL query to create a recordset.
You will need to know something about the MS Word object model to get the Recordset data into the Word document.
March 19, 2007 at 3:12 am
thanks people.
managed to do it in the end, found that none of the activex refences are turned on by default.
all ok after i did that.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply