Splitting Merge to a printer

T

Tony

Hi there,
I am wanting to do a mail merge direct to the copier and have each record
split into 'sections' so I can utilise the printer's finishing features.
I have a 4 page merge which I want double sided and stapled. Only problem is
that when you have 400 records you end up with a 1600 page document which you
have to hand staple. I want to treat each record as its own document and
apply finishing features to each record and end up with 400 stapled sets. I
think maybe a macro will do this but I can't seem to find such a thing to
actually work. Word version is 2002 SP3 (or 2003 SP1 on another machine).
Anybody who can help will be greatfully appreciated!!

Thankyou heaps
 
P

Peter Jamieson

You can try the following VBA, but if you are trying to do anything like
"get the paper for different parts of each document from different paper
bins" then something more is likely to be needed:

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

If you haven't used Word VBA Macros before, see

http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm

As for "applying finishing features to each document," the above macro
obviously assumes that everything you need can be set in the printer driver
and is the same for each document.

Peter Jamieson
 
D

Doug Robbins - Word MVP

Execute the merge to a new document and then run a macro containing the
following commands when that document is the Active Document. Each letter
will then be sent to the printer as a separate print job:

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


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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