View Full Version : Word Merge With Runtime


shadow9449
09-21-2008, 06:47 AM
In my applications, I often allow the user to merge filtered data to Word. It's pretty easy to do using the runcommand (I'll show how I do it below). My problem is that to do so, you have to create a table, open the table and then run the command. The problem with this is that if the user has the Access Runtime installed, the application shuts down.

Here's how I do it:

Dim strSql As String

' Start by getting the fltered data into my merge table
sql = "SELECT ... " & _
" INTO merge_table FROM ....WHERE ..."

DoCmd.RunSQL strSql

DoCmd.Echo False

'Open the table silently; the user doesn't need to see it open!

DoCmd.OpenTable "merge_table"
DoCmd.RunCommand acCmdWordMailMerge
DoCmd.Close acTable, "merge_table"
DoCmd.Echo True



Works perfectly IF the user has a full installation of Access installed. You can't open tables using the Runtime so it fails. Does anyone know of a way to get this working with the Runtime? Yes, I'm aware of the Supereasy word merge but this is preferred if it's possible.

Some points:

- Some examples of the acCmdWordMailMerge involve selecting the query or table before the merge. That can't be done, even programatically, using the Runtime
- Anything requiring references to Word will bomb out unless the user happens to have the same version of Word as me. Of course using the Runtime that can't be altered.

Thanks

SHADOW

Pat Hartman
09-21-2008, 07:48 PM
Why do you have to open the table? Have you tried the merge without it?

shadow9449
09-21-2008, 09:26 PM
Why do you have to open the table? Have you tried the merge without it?

The only ways I can think of using the Runcmd is either by opening it or by selecting it. Am I overlooking something?

SHADOW