H
hlz
Hi there
I've set up a form to prepare standard letters for an enquiry process. To
make it easy for the end users to make any changes to the standard text
required in the future, I've exported the required data to a mailmerge
document in Word rather than create these letters in report format.
The mail merge document opens, merges to a new document which is printed and
then both documents are closed.
However, I'd like to be able to specify which printer this is sent to and,
preferably, that it's sent to the manual feed tray but I'm not sure how to do
this?
Will be using Access and Word 2002.
All help/pointers will be greatly appreciated.
hlz
---
Dim objWord As Object
Set objWord = GetObject("C:\Database\Enquiry Letter (Weddings).doc",
"Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source
objWord.MailMerge.OpenDataSource _
Name:="C:\Database\Ceremony Bookings.mdb", _
LinkToSource:=True, _
Connection:="TABLE Q_InitialEnquiryLetter", _
SQLStatement:="SELECT * FROM [Q_InitialEnquiryLetter]"
' Execute the mail merge.
objWord.MailMerge.Destination = wdSendToNewDocument
objWord.MailMerge.Execute
objWord.Application.Options.PrintBackground = False
objWord.Application.ActiveDocument.PrintOut
objWord.Application.ActiveDocument.Close (wdDoNotSaveChanges)
objWord.Close (wdDoNotSaveChanges)
I've set up a form to prepare standard letters for an enquiry process. To
make it easy for the end users to make any changes to the standard text
required in the future, I've exported the required data to a mailmerge
document in Word rather than create these letters in report format.
The mail merge document opens, merges to a new document which is printed and
then both documents are closed.
However, I'd like to be able to specify which printer this is sent to and,
preferably, that it's sent to the manual feed tray but I'm not sure how to do
this?
Will be using Access and Word 2002.
All help/pointers will be greatly appreciated.
hlz
---
Dim objWord As Object
Set objWord = GetObject("C:\Database\Enquiry Letter (Weddings).doc",
"Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source
objWord.MailMerge.OpenDataSource _
Name:="C:\Database\Ceremony Bookings.mdb", _
LinkToSource:=True, _
Connection:="TABLE Q_InitialEnquiryLetter", _
SQLStatement:="SELECT * FROM [Q_InitialEnquiryLetter]"
' Execute the mail merge.
objWord.MailMerge.Destination = wdSendToNewDocument
objWord.MailMerge.Execute
objWord.Application.Options.PrintBackground = False
objWord.Application.ActiveDocument.PrintOut
objWord.Application.ActiveDocument.Close (wdDoNotSaveChanges)
objWord.Close (wdDoNotSaveChanges)