Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Modified SplitMerge added page
I combined parts and modified the SplitMerge macros on site hosted by gmayor
(many thanks to graham and Doug Robbins); to name the split docs with unique name from mergfield in doc and save to selected location. It works fine except it creates an extra blank page with each letter, does any one know what I need to change or add to keep the extra page from being created, or to automatically delete it. thanks, owen Here is the Macro as written: Sub SplitMergeDocWithName() ' SplitMergeDoc Macro modified to save individual letters with ' information from data source. The filename data must be added to ' the top of the merge letter and must be unique. Dim Default As String Dim MyPath As String Selection.EndKey Unit:=wdStory Letters = Selection.Information(wdActiveEndSectionNumber) Selection.HomeKey Unit:=wdStory Counter = 1 Default = "" Title = "Save To" MyText = "Enter File Location" MyPath = InputBox(MyText, Title, Default) If MyPath = "" Then End End If 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 = MyPath & 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 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to open a word doc to last modified page... | Microsoft Word Help | |||
Problem arises when ref bookmark is added in the header ,it does not take the modified values and displays the same old values | Microsoft Word Help | |||
Problem arises when ref bookmark is added in the header ,it does not take the modified values and displays the same old values | Microsoft Word Help | |||
title page being added to page total | Microsoft Word Help | |||
can the web page wizard be added to office2003 | Microsoft Word Help |