Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / November 2003

Tip: Looking for answers? Try searching our database.

Multiple files from Mail Merge.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Terry - 04 Nov 2003 18:58 GMT
I have created a mail merge document and now want to take
each of those files and save them seperately into
individual files.  Can this be done?  What steps do I take
to peform the task.
Peter Jamieson - 05 Nov 2003 01:08 GMT
Word doesn't have a built in feature for this, so you need a macro.
Something like

Sub splitandsave()

Dim i As Integer
Dim intDocumentCount As Integer
Dim strDocumentName As String
Dim oDoc As Document
Dim oPrintDoc As Document
Set oDoc = ActiveDocument
intDocumentCount = oDoc.Sections.Count
For i = 1 To intDocumentCount
 oDoc.Sections.First.Range.Cut
 Set oPrintDoc = Documents.Add
 With oPrintDoc
   .Content.Paste
   If .Sections.Count > 1 Then
     .Sections(2).PageSetup.SectionStart = wdSectionContinuous
   End If
' change the following line to put the documents in the path you want with
the names you want.
   .SaveAs "doc" & CStr(i) & ".doc"
   .Close Savechanges:=False
 End With
Next
Set oPrintDoc = Nothing
Set oDoc = Nothing
End Sub

--
Peter Jamieson
MS Word MVP

> I have created a mail merge document and now want to take
> each of those files and save them seperately into
> individual files.  Can this be done?  What steps do I take
> to peform the task.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.