SEPERATE DOCUMENTS FOR MAIL MERGE

M

MARINA MORENO

I CREATED A MAIL MERGE, AND I WANT TO FIND OUT IF THERE
IS A WAY TO SEPERATE THE DOCUMENTS RATHER THAN ONE HUGE
DOCUMENT? I AM NOT FAMILIAR WITH MACROS, IS THERE ANY
OTHER WAY TO DO THIS?
 
D

Doug Robbins

Please don't SHOUT!

Sub splitter()

' splitter Macro

' Macro created by Doug Robbins to save each letter created by a mailmerge
as a separate file.

Dim Letters As Integer, Counter As Integer, Source as Document, Target as
Document, Letter as Range
Set Source = ActiveDocument
Letters = Source.Sections.Count
For i = 1 to Letters
Set Letter = Source.Sections(i).Range
Letter.End=Letter.End-1
Set Target = Documents.Add
Target.Range=Letter
Target.SaveAs FileName:="Letter" & i, FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
Target.Close
Next i

End Sub

If you don't know what to do with it, see the article "What do I do with
macros sent to me by other newsgroup readers to help me out?" at:

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


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
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