View Single Post
  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mailmerge using different printer trays

Thanks for the feedback - but if you're still following the thread, it
sounds as if your Access report is doing exactly the same thing in
principle, i.e. sending one sheet to one tray and the second sheet to the
second tray - so do you have any clues at all as to why it works quickly
when using Access but not (apparently) using Word?

Peter Jamieson


"Not_a_notes_fan" wrote in message
...
Thanks for your help Peter. This did work, although the printer itself
slowed
the whole process down. It had to stop the motors to change the paper path
so
creating a delay that was unbearable

So, I have recreated the documents into Access reports that are called
from
the data entry form with a command button. Each time a new record is
created
the code saves the record, and outputs the documents.

Thanks again

"Peter Jamieson" wrote:

OK, try the following macro on a small sample (2 or 3 letters should be
enough for starters), with the mail merge main document set up either as
a
single section with a page break (as you originally had it) or as two
sections. Still not sure it will work, but let's see.

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

"Not_a_notes_fan" wrote in
message
...
I have tried your suggestion which said to use section breaks to no
avail.
I
have also tried merging to a new document and used a maco found
elsewhere
on
the forum to seperate the pages still with no luck. The macro is he

Dim i As Long
With ActiveDocument
For i = 1 To .Sections.Count
.PrintOut Range:=wdPrintFromTo, From:="s" & i, To:="s" & i
Next i
End With

Now unsure what else to do.

An alternative approach would be to use a section break instead of a
page
break and set up section 1 to print to one tray and section tray to
print
to
the other tray. Then test printing direct to the printer. If you want,
output the merge to a new document and verify that each section is
associated with the correct tray.