Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Hello
I want to seperate big mailmerge into 500 pages steps. Can me somebody help to create this macro? King regards in advanced. Dirk |
#2
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
In the simple case where you have a letter layout that uses one page and
always corresponds to a single record in the data source, you can use something like Sub batchmerge() ' number of records to process ' per batch Const BatchSize As Long = 500 ' a pathname for the output files ' We'll append the start record number ' (or you can merge to printer) Const FileStem = "c:\a\batch_starting_" Dim c As Long Dim objDoc As Word.Document c = 1 Set objDoc = ActiveDocument With objDoc.MailMerge .Destination = wdSendToNewDocument While c = .DataSource.RecordCount .DataSource.FirstRecord = c .DataSource.LastRecord = c + BatchSize - 1 .Execute ActiveDocument.SaveAs _ FileStem & CStr(c) ActiveDocument.Close c = c + BatchSize Wend End With Set objDoc = Nothing End Sub If each letter always consumes (say) 5 records in the data source then you could change Const BatchSize = 500 to Const BatchSize = 2500 However, if you have a more complicated letter where the number of records each letter consumes (e.g. you are producing invoices) then it's a different story because you do not actually know which record to start with each time, and I don't believ it is particularly easy to find out. Peter Jamieson http://tips.pjmsn.me.uk On 03/02/2010 15:38, Dirk wrote: Hello I want to seperate big mailmerge into 500 pages steps. Can me somebody help to create this macro? King regards in advanced. Dirk |
#3
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
See the €śIndividual Merge Letters€ť item on fellow MVP Graham Mayors website
at: http://www.gmayor.com/individual_merge_letters.htm -- Hope this helps, Doug Robbins - Word MVP Please reply only to the newsgroups unless you wish to obtain my services on a paid professional basis. "Dirk" wrote in message ... Hello I want to seperate big mailmerge into 500 pages steps. Can me somebody help to create this macro? King regards in advanced. Dirk |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Issues w/ Word MVP Macro to Mailmerge w/ Attachment | Mailmerge | |||
Mailmerge macro doesn't work in WORD 2007 | Mailmerge | |||
Mailmerge and Macro | Mailmerge | |||
MailMerge Macro HELP | Microsoft Word Help | |||
Word mailmerge to PDF macro | Mailmerge |