Help: Mail Merge Macro Problem

M

malycom

Hi

I am having trouble trying to write some code that will allow
selected page from a document to print based on merged information.

I have quite a few mergefields in both pages of the document but th
two main Mergefields are {MERGEFIELD "Feb_03_ZMK"} and {MERGEFIEL
"April_03_ZMK"}. Basically, I want to print page one of a document i
the first mergefield is showing a value greater than 0 and page 2 i
the second mergefield is showing a value greater than 0. I would lik
no pages to be printed if both fields are 0.

I have no idea how to go about this. Very new to trying to use VBA s
as much info as possible would be a great help.

Kind regards

malyco
 
G

Graham Mayor

What you propose is potentially quite complicated, and success would largely
depend on what is on the two pages of your document. A simpler plan would be
to insert the variable text according to the field content, rather than
select from two pages which presumably have further field codes. Then it
would be quite simple to insert the required bits of text using Autotext or
Includetext fields eg
{IF {MERGEFIELD Feb_03_ZMK} > 0 "Insert this"}{IF {MERGEFIELD April_03_ZMK}
0 "Insert this"}
"Insert this" can be just about anything.

You can repeat this structure wherever the text varies.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP
E-mail (e-mail address removed)
Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 

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