Here's a message from Graham Mayor (with a quote from me!) which may
help.Note that themacro will only work if you have exactly one output
document for each record in the data source.
---------------------------------------------------------------------------
This is not an uncommon problem and is probably attributable to limitations
in the printer driver and/or an incorrect setting in the printer options.
Different printers have different views of what the tray commands are so a
document setup for one printer may not work when printed on another.
There are a couple of possible workarounds.
If your printer driver accepts PCL commands, you could use a Print field at
the top of each page to send out the PCL command that will force the printer
to print that page from the required tray. A PRINT field is simply a type of
field that allows you to send instructions directly to the printer.
{ PRINT 27"&l1H" } - Tray 2
{ PRINT 27"&l4H" } - Tray 3
(but do check these commands with your printer manual as there are
variations).
or you could use a macro - this one was suggested by Peter Jamieson
Sub PrintOneDocPerSourceRec()
Dim intSourceRecord
Dim objMerge As Word.MailMerge
'Dim strOutputDocumentName As String
Dim TerminateMerge As Boolean
' Need to set up this object as the ActiveDocument changes when the
' merge is performed. Besides, it's clearer.
Set objMerge = ActiveDocument.MailMerge
With objMerge
' If no data source has been defined, do it here using OpenDataSource.
' But if it is already defined in the document, you should not need
' to define it here.
' .OpenDataSource _
' Name:="whatever"
intSourceRecord = 1
TerminateMerge = False
Do Until TerminateMerge
.DataSource.ActiveRecord = intSourceRecord
' if we have gone past the end (and possibly, if there are no records)
' then the Activerecord will not be what we have just tried to set it to
If .DataSource.ActiveRecord <> intSourceRecord Then
TerminateMerge = True
' the record exists
Else
.DataSource.FirstRecord = intSourceRecord
.DataSource.LastRecord = intSourceRecord
.Destination = wdSendToPrinter
.Execute
intSourceRecord = intSourceRecord + 1
End If
Loop
End With
End Sub