PDA

View Full Version : Macro to Save Mail Merger as individual files



calypso
11-15-2017, 01:23 PM
Hello,


I am trying to save a Mail Merger Word doc as individual files. I created the macro below to save the first of the 150 documents, but was hoping someone could help me fix the macro to loop and save all 150 mailmerger docs with subsequent file names, i.e. 001.docx, 002.docx, 003.docx, 004.docx, etc. : Would really appreciate some insight on how to do this properly. Thank you very much.


Sub Macro1()
'
' Macro1 Macro
'
'
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = 1
.LastRecord = 1
End With
.Execute Pause:=False
End With
ActiveDocument.SaveAs2 FileName:="Contact Info 001.docx", _
FileFormat:=wdFormatXMLDocument, LockComments:=False, Password:="", _
AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _
:=False, SaveAsAOCELetter:=False, CompatibilityMode:=15
ActiveWindow.Close
End Sub

macropod
11-15-2017, 03:14 PM
See Send Mailmerge Output to Individual Files in the Mailmerge Tips and Tricks thread at:
http://www.msofficeforums.com/mail-merge/21803-mailmerge-tips-tricks.html
or:
http://windowssecrets.com/forums/showthread.php/163017-Word-Mailmerge-Tips-amp-Tricks

gmayor
11-15-2017, 09:49 PM
Or you could simply use - http://www.gmayor.com/individual_merge_letters.htm or http://www.gmayor.com/MergeAndSplit.htm

calypso
11-17-2017, 11:58 AM
[QUOTE=macropod;372918]See Send Mailmerge Output to Individual Files in the Mailmerge Tips and Tricks thread at:

Hi Macropod. Thank you very much for providing these links, this was very helpful to find a solution.