Hello all,
I have a bit of code that runs a query to generate table with a single record from the form then opens up my word template which has the merge fields already set.
The problem is I then have to run through the mail merge settings in Word.
If I use the Word Merge button in Access, I have to go through windows explorer to get to the word template I need.
I am looking for a bit of code that when I click my command button, it runs the make table query, word merge, and opens the word file
Thanks,
Mark
I have a bit of code that runs a query to generate table with a single record from the form then opens up my word template which has the merge fields already set.
The problem is I then have to run through the mail merge settings in Word.
Code:
Private Sub GSIITB_Click()
DoCmd.OpenQuery "qry_ITBData", acViewNormal, acEdit
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then 'Word isn't already running
Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0
Set wdDoc = wdApp.Documents.Open("R:\Estimating Process\03 - New Task Order\ITB - GSI.dotx")
wdApp.Visible = True
DoCmd.RunCommand acCmdAppMinimize
End Sub
If I use the Word Merge button in Access, I have to go through windows explorer to get to the word template I need.
I am looking for a bit of code that when I click my command button, it runs the make table query, word merge, and opens the word file
Thanks,
Mark