Using Mail Merge to Autofill forms... and then separate them

D

Daniel Mullin

(PLEASE REMOVE THE x FROM MY ADDRESS WHEN REPLYING!)

Hi,

I have a text (tab-delimited) file which I want to dump
into a form, so that each line of the text file (similar
to a Row in Excel) is used to fill in a form, created in
Word. This is no problem and I have easily been able to
do so using Mail Merge.

However, is there an easy/practical way to separate the
resulting forms into individual files (each form is 2
pages long). I have tried to write a macro which will do
so, but the latest version of Word is giving me problems
(it says the number of pages in the "Form Letters" file
= 1). Any suggestions?


Thanks in advance,

Daniel M.
 
G

Greg

Daniel,

Doug Robbins posted the following last month:

Sub splitter()

' splitter Macro

' Macro created by Doug Robbins to save each letter
created by a mailmerge
as a separate file.

Dim Letters As Integer, Counter As Integer
Letters = ActiveDocument.Sections.Count
Selection.HomeKey Unit:=wdStory
Counter = 1
While Counter < Letters
DocName = "Myletter" & LTrim$(Str$(Counter))
ActiveDocument.Sections.First.Range.Cut
Documents.Add
Selection.Paste
ActiveDocument.Sections(2).PageSetup.SectionStart =
wdSectionContinuous
ActiveDocument.SaveAs FileName:=DocName, FileFormat:= _
wdFormatDocument, LockComments:=False,
Password:="",
AddToRecentFiles:= _
True, WritePassword:="",
ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False,
SaveFormsData:=False, _
SaveAsAOCELetter:=False
ActiveWindow.Close
Counter = Counter + 1
Wend

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top