Word mail merge and files per receiptent

J

Jørn A.

I use the Word mail merge functionality to mass produce letters.
I have a word template with defined fields and a data source (Excel-file).

The mail merge functionality however, merges the data source with the
template into one single Word-document containing all letters (multiple
receiptents in one file).
Is there a way to merge into on document/file per receiptent?

Second question:
To handle this missing functionality mentioned above, I made a VB snippet to
split the big merged document into one file per receiptent. This is how the
VB code I wrote performs this:
1. I make a SELECTION in the merged document (with multiple letters),
ranging from beginning to end of the letter for ONE person.
2. Copy this content to the clipboard.
3. Open a new blank document.
4. Paste it into the new blank document.
5. Saving to a new file.

The problem here however was: How can I specify a SELECTION in a document by
page numbers? I had to specify the SELECTION range by number of paragraphs,
which is not a precise specification.

All help appreciated.

-Jørn A.
 
D

DA

Don't bother with the splitting of the documents.
Here is a bit of code that merges one record at a time
for your selected range. This way you end up with
seperate documents after your merge.

Note couple of things:
1)This assumes you've set up your data source and main
merge document.
2)I haven't included any error trapping etc,(which I'd
strongly suggest), but at least this should give you an
idea in order to get started.

Good luck,
Dennis

--------------
Sub Merge2MultiDoc()
Dim lngCounter As Long
Dim lng2Counter As Long

Set myMerge = ActiveDocument.MailMerge
lngCounter = InputBox("Merge From:")
lng2Counter = InputBox("Merge To:")
While lngCounter <= lng2Counter
With myMerge.DataSource
.FirstRecord = lngCounter
.LastRecord = lngCounter
lngCounter = lngCounter + 1
myMerge.Execute
'Place a save event here is you want to save the
'merged doc.
End With
Wend

End Sub
 

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