Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Saving letters individualy after a mail merge (but letter has two pages)
Hi all,
I'm trying to use this macro that i found on Graham Mayor's brillient website, but the problem is that each of my letters is two pages long. Is there anyway for me to modify this code? Sub SplitMergeLetter() ' splitter Macro modified to save individual letters with ' information from data source. The filename data must be added to ' the top of the merge letter - see web article. Selection.EndKey Unit:=wdStory Letters = Selection.Information(wdActiveEndSectionNumber) Selection.HomeKey Unit:=wdStory Counter = 1 While Counter Letters Application.ScreenUpdating = False With Selection .HomeKey Unit:=wdStory .EndKey Unit:=wdLine, Extend:=wdExtend .MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend End With sName = Selection Docname = "N:\My Documents\" & sName & ".doc" ActiveDocument.Sections.First.Range.Cut Documents.Add With Selection .Paste .HomeKey Unit:=wdStory .MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend .Delete End With ActiveDocument.SaveAs FileName:=Docname, _ FileFormat:=wdFormatDocument ActiveWindow.Close Counter = Counter + 1 Application.ScreenUpdating = True Wend End Sub Any help would be greatly appriciated. |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Saving letters individualy after a mail merge (but letter has two pages)
It should not need modifying UNLESS your mailmerge main document contains
more than one section. Does the main document contain multiple sections, if so, do you really need them. -- 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 wrote in message ups.com... Hi all, I'm trying to use this macro that i found on Graham Mayor's brillient website, but the problem is that each of my letters is two pages long. Is there anyway for me to modify this code? Sub SplitMergeLetter() ' splitter Macro modified to save individual letters with ' information from data source. The filename data must be added to ' the top of the merge letter - see web article. Selection.EndKey Unit:=wdStory Letters = Selection.Information(wdActiveEndSectionNumber) Selection.HomeKey Unit:=wdStory Counter = 1 While Counter Letters Application.ScreenUpdating = False With Selection .HomeKey Unit:=wdStory .EndKey Unit:=wdLine, Extend:=wdExtend .MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend End With sName = Selection Docname = "N:\My Documents\" & sName & ".doc" ActiveDocument.Sections.First.Range.Cut Documents.Add With Selection .Paste .HomeKey Unit:=wdStory .MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend .Delete End With ActiveDocument.SaveAs FileName:=Docname, _ FileFormat:=wdFormatDocument ActiveWindow.Close Counter = Counter + 1 Application.ScreenUpdating = True Wend End Sub Any help would be greatly appriciated. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
mail merge labels prints way too many pages | Mailmerge | |||
How do I get blank pages to disappear from a mail merge? | Mailmerge | |||
Query a mail merge for multiple letters at once? | Mailmerge | |||
Saving a merge letter changes previous letters | Mailmerge | |||
Mail Merge is creating blank pages between form letters | Mailmerge |