Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
aelewis aelewis is offline
external usenet poster
 
Posts: 2
Default Split a mail merge document into individual documents

Is it possible to split a merge document that has several section breaks
within one letter? For example, each individual letter has 2 - 5 section
breaks and then the Section Break (Next Page) ends that letter and begins the
next one.

"Doug Robbins - Word MVP" wrote:

Using this macro should overcome that problem:

Sub splitter()
' splitter Macro
' Macro created by Doug Robbins to save each letter created by a mailmerge
' as a separate file, retaining the header and footer information.
Dim i As Long, Source As Document, Target As Document, Letter As Range
Set Source = ActiveDocument
For i = 1 To Source.Sections.Count
Set Letter = Source.Sections(i).Range
Set Target = Documents.Add
Target.Range = Letter
Target.Sections(2).PageSetup.SectionStart = wdSectionContinuous
Target.SaveAs FileName:="Letter" & i
Target.Close
Next i
End Sub

It changes the section break at the end of each letter to a continuous
section break.
--
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

"Shelly Faye" wrote in message
...
I've hit another glitch - everything works great - the font is behaving
properly, the file names that are being saved are perfect - only one
problem
- after running the SplitMergeLetter macro, no matter what I do to the
bottom
of the merge letter original, the created file has a printing blank page
at
the end, with only a paragraph symbol on it.

At the very end of my original merge document, there is only one paragraph
mark that cannot be removed, and the large document that results from the
merge has no blank pages, only a section break after the last character on
each page, only after I split the letters does the blank page show up.

Can anyone help?


"Doug Robbins - Word MVP" wrote:

In place of the

Documents.Add

command in the macro, use

Documents.Add Template:="C:\Program Files\Microsoft Office" _
& "\Templates\Memos\Professional Memo.dot"replacing 'C:\Program
Files\Microsoft Office" _
& "\Templates\Memos\Professional Memo.dot"

With the name of the template used to create the mail merge main
document.
--
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

"Shelly Faye" wrote in message
...
Thank you for your "splitmergeletter" macro - it really helps - except
for
one thing - formatting is coorect when I merge to new doc - it changes
the
font only when I execute your macro??!!

Why?

The original letter is in Arial, the resulting letters are in Arial,
the
split letters are in Times New Roman - and as there is a specific look
on
the
page - eg letterhead also in Arial, we want to preserve the original
look.

Thank you for your help.

"Graham Mayor" wrote:

See http://www.gmayor.com/individual_merge_letters.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




leedelee wrote:
How do I take a mail merge document and then split it up into
individual documents to save each letter in a separate place?









  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Split a mail merge document into individual documents

Yes with the proviso that while the number of sections may vary from mail
merge main document to mail merge main document, there would need to be a
constant number of sections for the one mail merge main document. That is,
if by the use of an If...then...Else construction in the mailmerge main
document you were inserting section breaks, then it would not be possible,
or at least would be very difficult to do it via mail merge - A
"roll-your-own" VBA equivalent to Mail Merge would be a better way of
handling that situation.

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

"aelewis" wrote in message
...
Is it possible to split a merge document that has several section breaks
within one letter? For example, each individual letter has 2 - 5 section
breaks and then the Section Break (Next Page) ends that letter and begins
the
next one.

"Doug Robbins - Word MVP" wrote:

Using this macro should overcome that problem:

Sub splitter()
' splitter Macro
' Macro created by Doug Robbins to save each letter created by a
mailmerge
' as a separate file, retaining the header and footer information.
Dim i As Long, Source As Document, Target As Document, Letter As Range
Set Source = ActiveDocument
For i = 1 To Source.Sections.Count
Set Letter = Source.Sections(i).Range
Set Target = Documents.Add
Target.Range = Letter
Target.Sections(2).PageSetup.SectionStart = wdSectionContinuous
Target.SaveAs FileName:="Letter" & i
Target.Close
Next i
End Sub

It changes the section break at the end of each letter to a continuous
section break.
--
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

"Shelly Faye" wrote in message
...
I've hit another glitch - everything works great - the font is behaving
properly, the file names that are being saved are perfect - only one
problem
- after running the SplitMergeLetter macro, no matter what I do to the
bottom
of the merge letter original, the created file has a printing blank
page
at
the end, with only a paragraph symbol on it.

At the very end of my original merge document, there is only one
paragraph
mark that cannot be removed, and the large document that results from
the
merge has no blank pages, only a section break after the last character
on
each page, only after I split the letters does the blank page show up.

Can anyone help?


"Doug Robbins - Word MVP" wrote:

In place of the

Documents.Add

command in the macro, use

Documents.Add Template:="C:\Program Files\Microsoft Office" _
& "\Templates\Memos\Professional Memo.dot"replacing 'C:\Program
Files\Microsoft Office" _
& "\Templates\Memos\Professional Memo.dot"

With the name of the template used to create the mail merge main
document.
--
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

"Shelly Faye" wrote in message
...
Thank you for your "splitmergeletter" macro - it really helps -
except
for
one thing - formatting is coorect when I merge to new doc - it
changes
the
font only when I execute your macro??!!

Why?

The original letter is in Arial, the resulting letters are in Arial,
the
split letters are in Times New Roman - and as there is a specific
look
on
the
page - eg letterhead also in Arial, we want to preserve the original
look.

Thank you for your help.

"Graham Mayor" wrote:

See http://www.gmayor.com/individual_merge_letters.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




leedelee wrote:
How do I take a mail merge document and then split it up into
individual documents to save each letter in a separate place?











  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
aelewis aelewis is offline
external usenet poster
 
Posts: 2
Default Split a mail merge document into individual documents

Thank you for the information! This document is using If...then...Else
statements to insert the breaks.

"Doug Robbins - Word MVP" wrote:

Yes with the proviso that while the number of sections may vary from mail
merge main document to mail merge main document, there would need to be a
constant number of sections for the one mail merge main document. That is,
if by the use of an If...then...Else construction in the mailmerge main
document you were inserting section breaks, then it would not be possible,
or at least would be very difficult to do it via mail merge - A
"roll-your-own" VBA equivalent to Mail Merge would be a better way of
handling that situation.

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

"aelewis" wrote in message
...
Is it possible to split a merge document that has several section breaks
within one letter? For example, each individual letter has 2 - 5 section
breaks and then the Section Break (Next Page) ends that letter and begins
the
next one.

"Doug Robbins - Word MVP" wrote:

Using this macro should overcome that problem:

Sub splitter()
' splitter Macro
' Macro created by Doug Robbins to save each letter created by a
mailmerge
' as a separate file, retaining the header and footer information.
Dim i As Long, Source As Document, Target As Document, Letter As Range
Set Source = ActiveDocument
For i = 1 To Source.Sections.Count
Set Letter = Source.Sections(i).Range
Set Target = Documents.Add
Target.Range = Letter
Target.Sections(2).PageSetup.SectionStart = wdSectionContinuous
Target.SaveAs FileName:="Letter" & i
Target.Close
Next i
End Sub

It changes the section break at the end of each letter to a continuous
section break.
--
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

"Shelly Faye" wrote in message
...
I've hit another glitch - everything works great - the font is behaving
properly, the file names that are being saved are perfect - only one
problem
- after running the SplitMergeLetter macro, no matter what I do to the
bottom
of the merge letter original, the created file has a printing blank
page
at
the end, with only a paragraph symbol on it.

At the very end of my original merge document, there is only one
paragraph
mark that cannot be removed, and the large document that results from
the
merge has no blank pages, only a section break after the last character
on
each page, only after I split the letters does the blank page show up.

Can anyone help?


"Doug Robbins - Word MVP" wrote:

In place of the

Documents.Add

command in the macro, use

Documents.Add Template:="C:\Program Files\Microsoft Office" _
& "\Templates\Memos\Professional Memo.dot"replacing 'C:\Program
Files\Microsoft Office" _
& "\Templates\Memos\Professional Memo.dot"

With the name of the template used to create the mail merge main
document.
--
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

"Shelly Faye" wrote in message
...
Thank you for your "splitmergeletter" macro - it really helps -
except
for
one thing - formatting is coorect when I merge to new doc - it
changes
the
font only when I execute your macro??!!

Why?

The original letter is in Arial, the resulting letters are in Arial,
the
split letters are in Times New Roman - and as there is a specific
look
on
the
page - eg letterhead also in Arial, we want to preserve the original
look.

Thank you for your help.

"Graham Mayor" wrote:

See http://www.gmayor.com/individual_merge_letters.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




leedelee wrote:
How do I take a mail merge document and then split it up into
individual documents to save each letter in a separate place?












Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mail merge with attachments AS Mailmerge 5 April 9th 05 09:49 AM
save individual letters from a mail merge document Horta Mailmerge 6 March 25th 05 04:19 PM
Specific Email Merge w/ Specific Attachements Mark B Mailmerge 9 February 21st 05 05:10 AM
How to protect the main document in a mail merge process Antonio Ortiz Mailmerge 4 February 17th 05 09:05 PM
How to protect the main document in a mail merge process Antonio O Mailmerge 0 February 16th 05 04:29 PM


All times are GMT +1. The time now is 12:43 AM.

Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"