K
Kenny G
Hi,
I have a table that is built for a mail merge in an Access DB. The data is
already linked to the Word document. I just want to open the Word document
and print out a document for each record.
I go directly to the word document and I can see that the records are linked
to the document.
I have written some code in order to open that document from inside Access
and just print out the document.
Would someone in the know take a look at the code below and see what I am
doing wrong. I can't see the mail merge data on the underlying document.
It doesn't print all the underlying records - just one document with the
printed mail merge setup.
Private Sub cmdOpenMailMergeOtherCom_Click()
On Error GoTo Err_cmdOpenMailMergeOtherCom_Click
Dim objWord As Word.Application
Dim objDoc As Word.Document
Set objWord = New Word.Application
'Make Document Visible
objWord.Visible = True
'Open Document Using Path
Set objDoc = objWord.Documents.Add("S:\Quality & Process
Improvement\QPI\Infection Control\CommDisease.dot")
'objWord.PrintOut
'objDoc.Close wdDoNotSaveChanges
'objWord.Quit
Exit_cmdOpenMailMergeOtherCom_Click:
Exit Sub
Err_cmdOpenMailMergeOtherCom_Click:
MsgBox Err.Description
Resume Exit_cmdOpenMailMergeOtherCom_Click
End Sub
Thanks for your assistance,
I have a table that is built for a mail merge in an Access DB. The data is
already linked to the Word document. I just want to open the Word document
and print out a document for each record.
I go directly to the word document and I can see that the records are linked
to the document.
I have written some code in order to open that document from inside Access
and just print out the document.
Would someone in the know take a look at the code below and see what I am
doing wrong. I can't see the mail merge data on the underlying document.
It doesn't print all the underlying records - just one document with the
printed mail merge setup.
Private Sub cmdOpenMailMergeOtherCom_Click()
On Error GoTo Err_cmdOpenMailMergeOtherCom_Click
Dim objWord As Word.Application
Dim objDoc As Word.Document
Set objWord = New Word.Application
'Make Document Visible
objWord.Visible = True
'Open Document Using Path
Set objDoc = objWord.Documents.Add("S:\Quality & Process
Improvement\QPI\Infection Control\CommDisease.dot")
'objWord.PrintOut
'objDoc.Close wdDoNotSaveChanges
'objWord.Quit
Exit_cmdOpenMailMergeOtherCom_Click:
Exit Sub
Err_cmdOpenMailMergeOtherCom_Click:
MsgBox Err.Description
Resume Exit_cmdOpenMailMergeOtherCom_Click
End Sub
Thanks for your assistance,