Field Validation when writing macros

J

Jean-Pierre

Im working with Word 2000 (9.0.3821 SR-1).

I've created a mail merge document and inserted the fields
in their appropriate places. My problem is I want to
validate these fields on the actual merging from the one
document to the other. Ive tried writing a macro and
applying it on the new document, but the fields aren't
available 'cause the merging has already taken place, how
can I check the values of these fields while the documents
are merging?

Im writing it in VB and tried using the
ActiveDocument.Mailmerge object but had no luck.

Please help me.

Thank you!
 
J

John Grierson

Hi Jean-Pierre,

Have you considered going via Tools|MailMerge|Query
options instead of writing code?

John
 
C

Cindy M -WordMVP-

Hi Jean-Pierre,

What, more specifically, are you trying to validate?

If you had Word 2002 or later, then VBA would be an option as
you'd have the new MailMerge events to work with. But for
Word 2000 you'd need to process the actual data source
document, or the main merge document once it's connected to
the data source (looping through the records).
Im working with Word 2000 (9.0.3821 SR-1).

I've created a mail merge document and inserted the fields
in their appropriate places. My problem is I want to
validate these fields on the actual merging from the one
document to the other. Ive tried writing a macro and
applying it on the new document, but the fields aren't
available 'cause the merging has already taken place, how
can I check the values of these fields while the documents
are merging?

Im writing it in VB and tried using the
ActiveDocument.Mailmerge object but had no luck.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 
G

Guest

John the problem is I what to force a new page when a
certain field's value changes.

The code in VB would be Application.Selection.InsertBreak
I have done the validation on the fields and can loop
through the recordset but my problem is executing it when
the actual merge takes place. I hope Im not missing
something and that I have made myself more clear.

JP
 
G

Guest

I have replied but going to do it in more detail.
Ive inserted the fields in the main document. When I click
merge and set the parameters and then click merge again
the actual merging takes place as supposed to. Printing
multiple records on a page until the page is full. However
specificly grouped records cannot be displayed on the same
page. The MailMergeBeforeRecordMerge event in the Word
2002 object model would have been ideal, but how can I
execute the same sort of thing in word 2000?
 
C

Cindy M -WordMVP-

I have replied but going to do it in more detail.
Ive inserted the fields in the main document. When I click
merge and set the parameters and then click merge again
the actual merging takes place as supposed to. Printing
multiple records on a page until the page is full. However
specificly grouped records cannot be displayed on the same
page.
OK, I'm going to take this literally and interpret the
problem to be that you want to keep certain lines of text
together. The place to set that would be
Format/Paragraph/Line and Page Breaks. Select the line that's
generating a "group" and activate "Keep with next" as well as
"Keep together".

I am very aware that I'm probably not answering the question
you really have. But so far, it's not clear to me what this
is. Perhaps if you explain it in French we could get a bit
further? (Try to not use too much slang or picturesque
language!)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 

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