Word Merge With Runtime (1 Viewer)

shadow9449

Registered User.
Local time
Today, 13:31
Joined
Mar 5, 2004
Messages
1,037
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:
Code:
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
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 13:31
Joined
Feb 19, 2002
Messages
43,227
Why do you have to open the table? Have you tried the merge without it?
 

shadow9449

Registered User.
Local time
Today, 13:31
Joined
Mar 5, 2004
Messages
1,037
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
 

Users who are viewing this thread

Top Bottom