Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / October 2003

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daniel Mullin - 10 Oct 2003 03:18 GMT
(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.
Greg - 10 Oct 2003 13:59 GMT
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

>-----Original Message-----
>(PLEASE REMOVE THE x FROM MY ADDRESS WHEN REPLYING!)
[quoted text clipped - 18 lines]
>Daniel M.  
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.