Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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 | |
|
|
![]() |
||||
Thread | Forum | |||
mail merge with attachments | Mailmerge | |||
save individual letters from a mail merge document | Mailmerge | |||
Specific Email Merge w/ Specific Attachements | Mailmerge | |||
How to protect the main document in a mail merge process | Mailmerge | |||
How to protect the main document in a mail merge process | Mailmerge |