Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / January 2006

Tip: Looking for answers? Try searching our database.

How I get Word to.........

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Visionary Soup - 16 Jun 2005 20:15 GMT
print mailmerged documents to the printer and staple them separately?  For
example I sent 3 addressed 3 paged letters and the printer staple after all
the letter had been completed.  (9 sheets were then stapled!)
Peter Jamieson - 16 Jun 2005 20:40 GMT
This question pops up from time to time. The main possibilities are as
follows - (c) has definitely worked in other cases:
a. have a good look at the printer driver options, and see if there is any
way you can trigger the stapling action by, e.g. specifying that page or
perhaps the last page comes from a different bin. I doubt it, but worth
looking.
b. if you have a detailed technical manual for the printer that tells you
what sequence to send to trigger the stapling action, you may be able to put
that sequence into a { PRINT } field at the beginning or end of your
document. Again, PRINT only works in certain circumstances so it's a long
shot. You might also be able to work out what control sequence or postscript
code is used to trigger stapling by checking the "print to file" option in
File|Print and comparing the output of "stapled" and "non-stapled" documents
in e.g. Notepad. Also a long shot. You may find with Word XP you can issue
the corrct sequence in some way using Word Mailmerge events.
c. Instead of doing one merge for all the records in your data source, use
VBA to do one merge for each record in your data source. You should then see
one print job per packet rather than a 1500 page print job. Some starting
point code is as follows - you may find see the Print dialog for each merge,
depending on the version of Word. If your merge processes multiple source
data records per packet you will obviously need to modify the source code.

Sub OneMergePerSourceRec()
'

' NB, needs bettor error management and doubtless other things a VBA expert
' will point out.

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

d. Perform the merge to an output file and print each section in turn - you
would need to change this if you have more than one section in your mail
merge main document.

Sub PrintEachSection()
Dim iSectionCount As Integer
For iSectionCount = 1 To ActiveDocument.Sections.Count
   ActiveDocument.PrintOut Range:=wdPrintFromTo, From:="s" & iSectionCount,
To:="s" & iSectionCount
Next iSectionCount
End Sub

--
Peter Jamieson

> print mailmerged documents to the printer and staple them separately?  For
> example I sent 3 addressed 3 paged letters and the printer staple after
> all
> the letter had been completed.  (9 sheets were then stapled!)
amie - 19 Dec 2005 22:56 GMT
i have used d and gotten option d to work. however with my database growing,
merging to a document will not work as well with the size restraint. I hope
to get your option c to work. My document is 14 pages that will need to be
duplexed & stapled. The database and word doc are already merged. I used your
code
Sub OneMergePerSourceRec()
Dim intSourceRecord
Dim objMerge As Word.MailMerge
Dim strOutputDocumentName As String
Dim TerminateMerge As Boolean
Set objMerge = ActiveDocument.MailMerge
With objMerge
intSourceRecord = 1
TerminateMerge = False
Do Until TerminateMerge
.DataSource.ActiveRecord = intSourceRecord
If .DataSource.ActiveRecord <> intSourceRecord Then
TerminateMerge = True
.DataSource.FirstRecord = intSourceRecord
.DataSource.LastRecord = intSourceRecord
.Destination = wdSendToPrinter
.Execute
intSourceRecord = intSourceRecord + 1
End If
Loop
End With
End Sub

When I use this code it locks my computer & disables macros for that
document. What am I doing wrong?

> This question pops up from time to time. The main possibilities are as
> follows - (c) has definitely worked in other cases:
[quoted text clipped - 85 lines]
> > all
> > the letter had been completed.  (9 sheets were then stapled!)
Doug Robbins - Word MVP - 20 Dec 2005 05:02 GMT
Uncheck the Background Printing box in Tools>Options>Print and see it that
makes any difference.  When you do that, the document for each record will
be printed before the next one is merged.

Signature

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

>i have used d and gotten option d to work. however with my database
>growing,
[quoted text clipped - 136 lines]
>> > all
>> > the letter had been completed.  (9 sheets were then stapled!)
Doug Robbins - 16 Jun 2005 23:45 GMT
Execute the merge to a new document and then run a macro containing the
following code when that document is the active document:

Dim i As Long

For i = 1 To ActiveDocument.Sections.Count
   ActiveDocument.PrintOut Range:=wdPrintFromTo, From:="s" & i, To:="s" & i
Next i

Signature

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

> print mailmerged documents to the printer and staple them separately?  For
> example I sent 3 addressed 3 paged letters and the printer staple after
> all
> the letter had been completed.  (9 sheets were then stapled!)
dvya - 31 Jan 2006 01:10 GMT
Ive copied and pasted the code and its telling me that i have a syntax error.
Any advice?

Thank You,

DVYA

> Execute the merge to a new document and then run a macro containing the
> following code when that document is the active document:
[quoted text clipped - 9 lines]
> > all
> > the letter had been completed.  (9 sheets were then stapled!)
Doug Robbins - Word MVP - 31 Jan 2006 05:14 GMT
You probably have what was intended to be the third line of a four line
macro with a line break in it.  Try the following version which is less
likely to have the lines broken  by the email program:

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

Signature

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

> Ive copied and pasted the code and its telling me that i have a syntax
> error.
[quoted text clipped - 19 lines]
>> > all
>> > the letter had been completed.  (9 sheets were then stapled!)
leftnotracks - 16 Jun 2005 23:48 GMT
Your printer is doing the stapling, not Word. So it's your printer that needs
to be told where the staples go. That is probably done only at the Job level,
meaning it will staple every page of a print job.

You'll eed to print each section separately.

> print mailmerged documents to the printer and staple them separately?  For
> example I sent 3 addressed 3 paged letters and the printer staple after all
> the letter had been completed.  (9 sheets were then stapled!)

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.