How to Control Which Printer MS Word Prints To

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)
 
P

Piet Linden

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)

set the destination printer in code before you run the merge.

Albert has the code here:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top