abbaddon223
Registered User.
- Local time
- Yesterday, 22:37
- Joined
- Mar 13, 2010
- Messages
- 162
Hi,
I'm hoping someone can help please?
I have a db that is performing a mailmerge from access to word. All works fine.
I'm trying to find how and where I can put a line in the below to print more than one copy if anyone can help please?
Thanks in advance for any support!!
Dim LWordDoc As String
Dim oApp As Object
'Path to the word document
LWordDoc = "D:\Remote Applications\AIA Invoice Management\Mail_Merges\Bulk Merges\8 - 14 Days Chase Letter.docx"
If Dir(LWordDoc) = "" Then
MsgBox "Document not found."
Else
'Create an instance of MS Word
Set oApp = CreateObject(Class:="Word.Application")
oApp.Visible = True
'Open the Document
oApp.Documents.Open FileName:=LWordDoc
Set MyMerge = oApp.ActiveDocument.MailMerge
If MyMerge.State = wdMainAndSourceAndHeader Or _
MyMerge.State = wdMainAndDataSource Then
With MyMerge.DataSource
.FirstRecord = 1
.LastRecord = 100000
End With
End If
With MyMerge
.Destination = wdSendToPrinter
.Execute
End With
oApp.ActiveDocument.Close
oApp.Quit
Set oApp = Nothing
Set MyMerge = Nothing
I'm hoping someone can help please?
I have a db that is performing a mailmerge from access to word. All works fine.
I'm trying to find how and where I can put a line in the below to print more than one copy if anyone can help please?
Thanks in advance for any support!!
Dim LWordDoc As String
Dim oApp As Object
'Path to the word document
LWordDoc = "D:\Remote Applications\AIA Invoice Management\Mail_Merges\Bulk Merges\8 - 14 Days Chase Letter.docx"
If Dir(LWordDoc) = "" Then
MsgBox "Document not found."
Else
'Create an instance of MS Word
Set oApp = CreateObject(Class:="Word.Application")
oApp.Visible = True
'Open the Document
oApp.Documents.Open FileName:=LWordDoc
Set MyMerge = oApp.ActiveDocument.MailMerge
If MyMerge.State = wdMainAndSourceAndHeader Or _
MyMerge.State = wdMainAndDataSource Then
With MyMerge.DataSource
.FirstRecord = 1
.LastRecord = 100000
End With
End If
With MyMerge
.Destination = wdSendToPrinter
.Execute
End With
oApp.ActiveDocument.Close
oApp.Quit
Set oApp = Nothing
Set MyMerge = Nothing