Mail Merge Help

B

blackX

I have a total of 8 different letters that needs to merged with a single data
source. Using include text I was able to do this. My first problem is that
4 of the letters need to be printed using the paper in tray 1 and the other 4
need to use the paper in tray 2. My second problem is that some of the
letters use a .5" margin and the rest use a .3" margin. Can I conditionally
set the margins in the Main.doc so the letter margins are correct? Thanks
 
P

Peter Jamieson

My personal opinion is that you will find it extremely difficult to solve
either of the two problems you mention using a single merge in Word, and it
is likely to be much simpler and more maintainable to create a number of
mrges, each of which selects the records it needs, uses a single layout, and
specifies a particular paper source.

If you want to attack the problem of several layouts in a single merge,
you're in luck, because there is a current discussion on this subject - look
for the conversation titled "Mergefields, IF statements and section breaks"
started by JAnderson on 16 July 2008. I cannot say that it will solve your
margin problems - in the past, I have not been able to come up with a merge
that will do that, but that does not mean that it cannot be done.

As for the paper tray problem, if you base a solution on the results of the
discussion I mentioned above, then you have also to work out how to
associate each output section with a different tray. IMO that is another
good reason to find a different approach:)

On the specific subject of the margins, if you are the author of all the
layouts you are using, you may be able to make things slightly easier for
yourself by keeping to a fixed set of Word page layouts, but e.g. modifying
all your paragraph layouts so that the documents that need a 0.5in margin
use a 0.3in margin but al have indents of 0.2in.
 
B

blackX

I figured so. I like your idea on for the margins and I think that will
work. I am trying to automate as much of this as I can. I started with 16
different letters and 16 data sources and I have got it down to 8 letters and
1 data source. If I can solve the tray selection problem that I will have
this whole process down to a few clicks. If not then she will just have to
filter the query inside of word and do the seperate projects individually.
Logically you would think that it could be as simple as
lettercode1,2,3,4=tray1, lettercode5,6=tray2, lettercode7,8=tray3 but I guess
I am just wishing. I will check out the link you provided and I appreciate
your help.
 
P

Peter Jamieson

Logically you would think that it could be as simple as
lettercode1,2,3,4=tray1, lettercode5,6=tray2, lettercode7,8=tray3 but I
guess
I am just wishing.

Yes, IMO ideally it would be as simple as you say. But if not, the next best
thing, assuming you can handle the formatting issues (left margin etc.)
/might be/ to output to a new mail merge main document, then run a macro
that specifies which Word sections should be printed to which printer tray.
And whether that works or not may depend on your printer driver.

Key question 1 is whether or not it is realistic for you to merge to an
output document, e.g. if you have 100 documents, maybe it's do-able, but
with 10,000, maybe the output is just too large?

Key question 2 is: let's suppose you experiment with a very small subset of
your data - say, 5 documents. Can we create a macro to help print those
documents to the correct ouytput trays?
 
G

Graham Mayor

You *MAY* be able to address the paper tray issue with PRINT fields, if your
printer accepts PCL or Postscript commands. A PRINT field is simply a type
of field that allows you to send instructions directly to the printer.
e.g. for horizontal duplex (PCL) you would insert the following field :
{ PRINT 27"&l2S" }
Lookup the commands to select the trays in your printer manual.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

blackX

I am confident that we can deal with the margin issues but the print tray
problem is still lingering. I would be open to try the Macro but I have
never worked with them so I dont know where to begin. Do you have any
suggestions. FYI: If I am able to get all of these issues resolved we would
be talking about 1000-1500 letters per merge. Currently this is considerably
lower but it is but she runs 16 seperate merges (one for each letter).
Thanks again
 
B

blackX

Okay I will look into this. IF the print does accept PCL, then will it tell
the code in the book?
 
B

blackX

I would like to try your MACRO idea but I know nothing about them. Do you
have any ideas to help with this?
 
G

Graham Mayor

If your printer is PCL or Postscript compatible and using the appropriate
driver then yes the information should be in the book or on the
manufacturer's web site.

As for the macro referred to in the other branch of the thread, then
provided you have the tray allocations set for the various sections, merge
to a new document and then see if the following macro does the job:

Sub SplitMergeLetterToPrinter()
' splitter Macro
' Macro created 16-08-98 by Doug Robbins to print each letter created by a
' mailmerge as a separate file.
'
Letters = ActiveDocument.Sections.Count
Counter = 1
While Counter < Letters
ActiveDocument.PrintOut Background:=False, Range:=wdPrintFromTo, _
From:="s" & Format(Counter), To:="s" & Format(Counter)
Counter = Counter + 1
Wend
End Sub

http://www.gmayor.com/installing_macro.htm


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
P

Peter Jamieson

It's certainly worth trying the { PRINT } field option that Graham
mentioned, as it's simpler if it works, but it only works with some printers
(and drivers), /and/ you have to be able to find out what the correct tray
selection sequences are (increasingly difficult in my experience and
probably requires a good look at the manufacturer's documentation CD or a
bit of searching around on their web site).

Otherwise you would probably need to run a macro post-merge, and that macro
would need to have some way of knowing which document should use paper from
which tray, because by the time the merge is complete, that information is
lost. So supposing you put a single digit 1,2, or 3 at the beginning of each
mail merge main document, select the digit and format it as hidden. Then you
could
a. merge to an output document
b. with that output document open and selected (i.e. the Active Document
and Active Window, run

Sub SetUpInputTrays()
Dim bShowHiddenText As Boolean
Dim s As Word.Section
bShowHiddenText = ActiveWindow.View.ShowHiddenText
ActiveWindow.View.ShowHiddenText = True
For each s in ActiveDocument.Sections
If Left(s.Range.Text, 1) = 1 Then
s.PageSetup.FirstPageTray = wdPrinterLowerBin
s.PageSetup.OtherPagesTray = wdPrinterLowerBin
Else
s.PageSetup.FirstPageTray = wdPrinterUpperBin
s.PageSetup.OtherPagesTray = wdPrinterUpperBin
End If
Next
ActiveWindow.View.ShowHiddenText = bShowHiddenText
End Sub

You would need to find out precisely which PageTray constants to use for
your printer (you can record a macro that sets up the trays you need and
have a look at the recorded code). You might need to modify this if you have
multi-section letters, etc. etc. You could also run the merge at the
beginning of the macro - typically, post-merge, the generated output dcument
is the activedocument.

I see graham has posted the "splitter" so that's another possibility.
 
B

blackX

I haven't tried any of these yet because I stumbled on another issue. I am
using include text to select the correct letter for each reciepent, but I
just noticed the the bullets in the source document are not transfered to the
MainMerge document. Also random words are bolded and words that should be
bold are not. Do you guys have any ideas? thanks in advance
 
G

Graham Mayor

Make sure you use bulleted styles for your bulleted paragraphs and that the
style is copied to the template from which the base merge document was
created and/or to the merge document.. Avoid manual formatting. Use styles
to format your documents.

Ensure that there are no formatting switches applied to the IncludeText
fields or Mergeformat or charformat.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

blackX

Yes we are using styles and there are no switches applied to Include text or
merge format fields. Do you have any other ideas? This small detail could
squash the entire merge. Any help is much appreciated.
 

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