Please let me know if there is a way to do this.
Thanks in advance for any help on this problem!
Sharon
If you are using earlier versions of Word and
a. you want to build a table for /each/ record in the datasource, that may
be possible if all the data is in the record - if you can find the nearby
conversation I'm having with Jeff Rasnick in this group you may get some
ideas.
b. what you really want to do is process several records in the source for
each "output document", then there are ways using IF and NEXT fields, and/or
DATABASE fields that may help, although they have their limitations.
There are other possibilities but it might help if you can spell out exactly
what inputs you have and what outputs you are trying to produce.
--
Peter Jamieson
MS Word MVP
"Sharon Ray" <sr...@lashgroup.com> wrote in message
news:072601c2c0d7$6ffe8cd0$8ef82ecf@TK2MSFTNGXA04...
I'd prefer to call the macro during the
Document.MailMerge.Execute event vs. the open of the
document, but I'm not seeing an event for that. It may be
due to the fact that the word document was written prior
to our upgrade to XP. Or perhaps I need to set a
reference. Please let me know if you can help me to
divert my macro execution from the Document_Open to the
actual execution of the MailMerge.
Thanks,
Sharon
>.
>
The events are all described in the Microsoft Word Visual Basic Reference
that comes with Word XP. If you look at "What's new for Microsoft Word 2002
Developers"|New Events you will see a number of events such as
MailMergeBeforeRecordMerge Event, which is probably the one you need. They
are Application Events rather than Document Events which may be why you
haven't been able to find them yet.
I find that following the example in the Help file and adapting the example
in the article mentioned in there - "Using Events with the Application
Object" gets me started. The main thing to bear in mind is that the document
object being passed to the event handler (in this particular case) is the
/Mail Merge Main Document/, not the output document.
I suspect you are rather more familiar with VBA than I am but if you need
more help than that, by all means ask again. It sounds as if these events
are just what you need if you are inserting from a secondary source via ADO.
--
Peter Jamieson
MS Word MVP
"Sharon Ray" <sr...@lashgroup.com> wrote in message
news:040501c2c15e$c3c947b0$8df82ecf@TK2MSFTNGXA02...
Thanks again,
Sharon
>.
>