Separating word mail merge documents

S

Secret

If one creates a mail merge consisting of about 500 letters for example, when
the merge is complete the letters are shown in one document, one letter after
another. Is there a way of saving each individual letter into another blacnk
document to be saved in its individual file without having to copy and paste
each letter every time. There must be an easier way of performing this task
as copy and paste is time consuming. If it involves macros could you explain
them to me please?

Many thanks

Secret
 
S

Secret

It would seem that this link only works for documents that haven't yet been
created. Mine has and just needs saving into individual documents so I can
save into files. In any case, I can't seem to get the macro into the
document(s) I need. Or maybe I'm just doing it wrong!

I think I'll probably have to copy and paste for now and remember this for
the enxt merge.

Thanks anyway

Secret
 
D

Doug Robbins - Word MVP

Use one or the other of the following macros that are available on Graham's
website. If you do not know what to do with them, click on the link "How to
Install Macros" before the Patience heading.

Sub Splitter()
' splitter Macro
' Macro created 16-08-98 by Doug Robbins to save each letter created by a
' mailmerge as a separate file.
' With minor modifications by Graham Mayor 10-02-03
Dim mask As String
Selection.EndKey Unit:=wdStory
Letters = Selection.Information(wdActiveEndSectionNumber)
mask = "ddMMyy"
Selection.HomeKey Unit:=wdStory
Counter = 1
While Counter < Letters
DocName = "D:\My Documents\Temp\Workgroup\" & Format(Date, mask) _

& " " & LTrim$(Str$(Counter)) & ".doc"
ActiveDocument.Sections.First.Range.Cut
Documents.add
With Selection
.Paste
.EndKey Unit:=wdStory
.MoveLeft Unit:=wdCharacter, Count:=1
.Delete Unit:=wdCharacter, Count:=1
End With

ActiveDocument.SaveAs FileName:=DocName, FileFormat:=wdFormatDocument
ActiveWindow.Close
Counter = Counter + 1
Wend
End Sub



As an alternative, the following macro provides the opportunity to provide
the fixed portion of the filename and to change the path of the saved files:



Sub SplitMerge()
' splitter Macro
' Macro created 16-08-98 by Doug Robbins to save each letter created by a

' mailmerge as a separate file.
' with modifications by Graham Mayor 16-06-03 & 08-10-04
Dim Title As String
Dim Default As String
Dim MyText As String
Dim MyName As Variant
Dim MyPath As String
Selection.EndKey Unit:=wdStory
Letters = Selection.Information(wdActiveEndSectionNumber)
Selection.HomeKey Unit:=wdStory
Counter = 1
Default = "Merged"
MyText = "Enter a filename. Long filenames may be used."
Title = "File Name"
MyName = InputBox(MyText, Title, Default)
If MyName = "" Then
End
End If
Default = "D:\My Documents\Test\"
Title = "Path"
MyText = "Enter path"
MyPath = InputBox(MyText, Title, Default)
If MyPath = "" Then
End
End If
While Counter < Letters
Application.ScreenUpdating = False
Docname = MyPath & LTrim$(Str$(Counter)) & " " & MyName & ".doc"
ActiveDocument.Sections.First.Range.Cut
Documents.Add
With Selection
.Paste
.EndKey Unit:=wdStory
.MoveLeft Unit:=wdCharacter, Count:=1
.Delete Unit:=wdCharacter, Count:=1
End With
ActiveDocument.SaveAs FileName:=Docname, FileFormat:=wdFormatDocument
ActiveWindow.Close
Counter = Counter + 1
Application.ScreenUpdating = True
Wend
End Sub



--
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
 
K

Karen Raif

Graham,
I used the instructions to merge letters into separate files based on
Recipient's name. Love it. Is there anyway to speed up the process of
having to email each letter (individual letters to individual email
addresses)? Currently, I highlight a letter, select send to, select email
recipient, then add the email address.
Karen
 
G

Graham Mayor

My thoughts too, though there are formatting issues. For e-mail I would be
inclined to e-mail attachments to which end see the article prepared by
fellow MVP Doug Robbins at
http://word.mvps.org/FAQs/MailMerge/MergeWithAttachments.htm or if the data
source is Outlook MAPI Labs Outlook Mailmerge Toolkit makes the task a
little easier for a modest sum, and reputedly makes html e-mailing more
reliable simply by having it installed(?).

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - 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