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 / March 2005

Tip: Looking for answers? Try searching our database.

save individual letters from a mail merge document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Horta - 10 Mar 2005 15:47 GMT
I am creating a 30 letter mail merge and I would like to be able to pdf each
letter to forward electronically.  I have no problems with the mail merge, or
the pdf, but cannot find a way to seperate each letter without cutting and
pasting each letter into another document.
Doug Robbins - 11 Mar 2005 02:43 GMT
Assuming that you are using File>Print with a .PDFing thingy set to create
the PDF, use the following macro on the document created by executing the
mailmerge to a new document

Dim i as Long
For i = 1 to ActiveDocument.Sections.Count
   ActiveDocument.PrintOut Range:=wdPrintFromTo, From:="s" & i, To:="s" & i
Next i

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

>I am creating a 30 letter mail merge and I would like to be able to pdf
>each
> letter to forward electronically.  I have no problems with the mail merge,
> or
> the pdf, but cannot find a way to seperate each letter without cutting and
> pasting each letter into another document.
chartwell52655 - 11 Mar 2005 19:01 GMT
How do I separate each document when the template I am merging from contains
section breaks?

> Assuming that you are using File>Print with a .PDFing thingy set to create
> the PDF, use the following macro on the document created by executing the
[quoted text clipped - 11 lines]
> > the pdf, but cannot find a way to seperate each letter without cutting and
> > pasting each letter into another document.
Doug Robbins - 12 Mar 2005 04:46 GMT
Sub splitter()

' splitter Macro

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

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
   Letter.End=Letter.End-1
   Set Target = Documents.Add
   Target.Range=Letter
   Target.SaveAs FileName:="Letter" & i
   Target.Close
Next i

End Sub

If you want each file to be named based on one of the fields in the data
source,
here's a method that I have used that involves creating a separate
catalog type mailmerge maindocument which creates a word document containing
a table in each row of which would be your data from the database that you
want to use as the filename.

You first execute that mailmerge, then save that file and close it.  Then
execute the mailmerge that you want to create the separate files from and
with the
result of that on the screen, run a macro containing the following code
and when the File open dialog appears, select the file containing the table
created by the first mailmerge

' Throw Away Macro created by Doug Robbins
'
Dim Source As Document, oblist As Document, DocName As Range, DocumentName
As String
Dim i As Long, doctext As Range, target As Document
Set Source = ActiveDocument
With Dialogs(wdDialogFileOpen)
   .Show
End With
Set oblist = ActiveDocument
Counter = 1
For i = 1 To oblist.Tables(1).Rows.Count
   Set DocName = oblist.Tables(1).Cell(i, 1).Range
   DocName.End = DocName.End - 1

   'Change the path in the following command to suit where you want to save
the documents.
   DocumentName = "I:\WorkArea\Documentum\" & DocName.Text
   Set doctext = Source.Sections(i).Range
   doctext.End = doctext.End - 1
   Set target = Documents.Add
   target.Range.FormattedText = doctext
   target.SaveAs FileName:=DocumentName
   target.Close
Next i

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> How do I separate each document when the template I am merging from
> contains
[quoted text clipped - 19 lines]
>> > and
>> > pasting each letter into another document.
sayling - 22 Mar 2005 15:17 GMT
Hmmm

This almost sounds like what I am looking for...

I have a document that gets merged to email automatically ( ie it runs
unattended at present). I am looking to try and get the subject of the email
to equal a couple of merge fields from the document (such as a date field and
a customer field, both held in the data source) using Word and Outlook 2000.

I get the impression that it would be easier to have the merge set to
produce different documents and let the email subject default to the document
name. So it sounds as though your 'throw away' splitter might do the job, but
(and you'll have to excuse my vba ignorance here) it appears that manual
intervention is required here...

Have I missed the point, or can the whole process be automated?

> Sub splitter()
>
[quoted text clipped - 79 lines]
> >> > and
> >> > pasting each letter into another document.
Charles Kenyon - 22 Mar 2005 15:59 GMT
See http://www.gmayor.com/individual_merge_letters.htm which does
automatically name the documents. See
http://addbalance.com/word/wordwebresources.htm#mailmerge for more mailmerge
links.
Signature

Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

> Hmmm
>
[quoted text clipped - 111 lines]
>> >> > and
>> >> > pasting each letter into another document.
sayling - 25 Mar 2005 17:19 GMT
Thanks, Charles. I've already accessed the page from Graham, which deals with
the splitting, but I can't see how to then get those individual files, from a
folder that will have it's contents increase in number every day, emailed to
a different address within each document, all unattended. And the second link
doesn't seem to throw much light on the problem.

Again, am I missing something (else)?

> See http://www.gmayor.com/individual_merge_letters.htm which does
> automatically name the documents. See
[quoted text clipped - 115 lines]
> >> >> > and
> >> >> > pasting each letter into another document.
 
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.