Macro

@

@

Is there a way to run a macro before (or after) each record is merged.
Is there a way to read the merge fields into the macro
 
G

Graham Mayor

What is it that you are trying to achieve?

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
@

@

I would like to run some test on the merge field and then pass stuff
back to the merge. The skipif and nextif statements are too limited
 
G

Graham Mayor

It's like drawing teeth :(
What stuff?

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
@

@

No its not... trust me I am also a dentist so I know (hope this will
not stop you from helping) but I also do some programing

Well you ask for it...The program we use has limited reporting ability
but a good mail merge program. We are trying to generate letters
with certain parameters


The actual criteria are complicated so I will make some up. For
instance, send a note to some who has not been in for a year or who
has not been in for six months if their last visit was an emergency
visit but do not send it if they asked not to recieve a letter. We are
able to get all this information from the mail merge module but it can
not selectviely filter it. Since mailmege does not support skipif in
an if statement I thought If i could use VBA to test for it an send
back a single variable telling the mail merge whether to skip that
record or not.

Got it? :)
 
G

grep

Sounds like you'd be better off doing much of that in the other program
you use; the one with the the good mail merge program. Let *it* do the
work of determining which records to export, and then let Word just
import whatever it says.

grep
 
P

Peter Jamieson

If it's Word 2002 or 2003 you can use the Word Mailmerge object's Events in
VBA to do a number of things at various points during a merge.
A starting point is

http://support.microsoft.com/default.aspx?scid=kb;en-us;285333

specifically the MailMergeBeforeRecordMerge Event

However, that option isn't available in Word 2000 or earlier.

If you're not familiar with Event code in VBA I would have a look at the
Word VBA Help examples.
 
G

Graham Mayor

I have no problem with dentists but see how much more help you get when you
tell us what it is you are trying to do. :)

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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