Reply
 
Thread Tools Display Modes
  #1   Report Post  
Horta
 
Posts: n/a
Default save individual letters from a mail merge document

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.


  #2   Report Post  
Doug Robbins
 
Posts: n/a
Default

Assuming that you are using FilePrint 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


--
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
"Horta" wrote in message
...
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.




  #3   Report Post  
chartwell52655
 
Posts: n/a
Default

How do I separate each document when the template I am merging from contains
section breaks?

"Doug Robbins" wrote:

Assuming that you are using FilePrint 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


--
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
"Horta" wrote in message
...
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.





  #4   Report Post  
Doug Robbins
 
Posts: n/a
Default

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


--
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
"chartwell52655" wrote in message
...
How do I separate each document when the template I am merging from
contains
section breaks?

"Doug Robbins" wrote:

Assuming that you are using FilePrint 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


--
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
"Horta" wrote in message
...
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.







  #5   Report Post  
sayling
 
Posts: n/a
Default

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?

"Doug Robbins" wrote:

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


--
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
"chartwell52655" wrote in message
...
How do I separate each document when the template I am merging from
contains
section breaks?

"Doug Robbins" wrote:

Assuming that you are using FilePrint 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


--
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
"Horta" wrote in message
...
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.










  #6   Report Post  
Charles Kenyon
 
Posts: n/a
Default

See http://www.gmayor.com/individual_merge_letters.htm which does
automatically name the documents. See
http://addbalance.com/word/wordwebre....htm#mailmerge for more mailmerge
links.
--
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.

"sayling" wrote in message
...
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?

"Doug Robbins" wrote:

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


--
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
"chartwell52655" wrote in
message
...
How do I separate each document when the template I am merging from
contains
section breaks?

"Doug Robbins" wrote:

Assuming that you are using FilePrint 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


--
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
"Horta" wrote in message
...
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.










  #7   Report Post  
sayling
 
Posts: n/a
Default

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)?

"Charles Kenyon" wrote:

See http://www.gmayor.com/individual_merge_letters.htm which does
automatically name the documents. See
http://addbalance.com/word/wordwebre....htm#mailmerge for more mailmerge
links.
--
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.

"sayling" wrote in message
...
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?

"Doug Robbins" wrote:

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


--
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
"chartwell52655" wrote in
message
...
How do I separate each document when the template I am merging from
contains
section breaks?

"Doug Robbins" wrote:

Assuming that you are using FilePrint 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


--
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
"Horta" wrote in message
...
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.











Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you save individual document pages as seperate word files? John Calligy Mailmerge 2 April 12th 05 09:14 AM
mail merge with attachments AS Mailmerge 5 April 9th 05 09:49 AM
Specific Email Merge w/ Specific Attachements Mark B Mailmerge 9 February 21st 05 06:10 AM
How to protect the main document in a mail merge process Antonio Ortiz Mailmerge 4 February 17th 05 10:05 PM
How to protect the main document in a mail merge process Antonio O Mailmerge 0 February 16th 05 05:29 PM


All times are GMT +1. The time now is 12:09 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"