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

Tip: Looking for answers? Try searching our database.

Saving Mail Merge Records   & also printing them.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Glenn - 20 Aug 2005 12:33 GMT
I've read the info Doug Robbins has posted on how to save individual mail
merge records.

I have two questions:

1)  Is there a way to specify a specific folder you want the document saved
into based on one of the merge fields?

and

2)  Is there a way to print the individual documents instead of saving them.
This might seem like an odd question.  I know that you can merge to printer.
However, I have a printer that does things such as back to back, folding,
stapling, etc.  Whenever I try to send a mail merge document through to it,
it considers all of the individual documents to be one big job.  So, if I
have five people in my database who are each receiving a two page letter
from me, and I want the first page to come from tray one because it is
special paper, what happens is that the very first page of the merge will
come from tray one and the rest of the pages will come from the default
tray.  I've tried numerous ways of doing this and nothing works.

I suppose that I could save them all as individual files and then select all
and print, but that seems like extra work that could be avoided.

Thanks,
Glenn
Doug Robbins - 20 Aug 2005 16:56 GMT
With the following method, the path plus the name could be taken from the
datasource:

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

To print each record separately, execute the merge to a new document and
then run the following macro on that document

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

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> I've read the info Doug Robbins has posted on how to save individual mail
> merge records.
[quoted text clipped - 23 lines]
> Thanks,
> Glenn
Glenn - 20 Aug 2005 18:40 GMT
Thanks, again.

I haven't tried the first part (saving), but I have tried the second part
(printing).

I tried it for two different documents.  The first one worked great.

The second one didn't work so great.  It seemed to be printing the document
in pieces.  After some investigating, I noticed that my original document
had different sections in it.  What happened is that when I ran the macro it
was printing each section for each merge recipient.  I'm guessing the "s" in
your code stands for section.

Is there anyway around this?  Some of my documents need to have various
sections in them due to headers & footers, etc.

Thanks.

> With the following method, the path plus the name could be taken from the
> datasource:
[quoted text clipped - 76 lines]
> > Thanks,
> > Glenn
Doug Robbins - 20 Aug 2005 20:59 GMT
First off, you need to consider whether they really do need to have more
than one section.  Maybe a Different First Page header and footer will
accomplish what you are now doing with separate sections.

If however you cannot avoid having a multi section mailmerge main document,
you would need to modify the macro as follows, where n is the number of
section in the mailmerge main document
Dim i As Long
With ActiveDocument
   For i = 1 To .Sections.Count, Step n
        .PrintOut Range:=wdPrintFromTo, From:="s" & i, To:="s" & i + n - 1
   Next i
End With

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Thanks, again.
>
[quoted text clipped - 110 lines]
>> > Thanks,
>> > Glenn
Jasy - 02 Sep 2005 14:12 GMT
Dear Mr.Douh Robbins
I have tried your throw away macro included in the reply and is working fine
except one problem..
During savng to separate files , the header and footer in the original
document strips out.
The saved file is wthout header and footer.
Any advice.

Thanks
Jasy

> First off, you need to consider whether they really do need to have more
> than one section.  Maybe a Different First Page header and footer will
[quoted text clipped - 128 lines]
>>> > Thanks,
>>> > Glenn

Rate this thread:






 
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.