Mailmerge processes only 2 records

J

Jeroen

Somehow the mailmerge processes only 2 records when I use
MailMergeBeforeRecordMerge event. In my main document I've got two tables
with each a bookmark. In the MailMergeBeforeRecordMerge event I want to
populate this tables with data:

lstraFields = Split(lstrInvalidDoc, "||")

For lnIndexFields = 0 To UBound(lstraFields)
lstrField = lstraFields(lnIndexFields)

With doc.Bookmarks(pstrTableName).Range.Tables(1)
.Cell(.Rows.Count, lnIndex).Range = lstrField
End With
Next

But somehow due to this insertion of the cell the mailmerge stops after two
records. If I remove the insertion of the cell and then loop through the code
with breakpoints, all records are processed.

Any ideas?

Kind regards,

Jeroen Walstra
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?SmVyb2Vu?=,

Somewhere, you have a line of code that contains mailmerge.Execute. The Execute
method has a Pause argument. Try setting this to FALSE.
Somehow the mailmerge processes only 2 records when I use
MailMergeBeforeRecordMerge event. In my main document I've got two tables
with each a bookmark. In the MailMergeBeforeRecordMerge event I want to
populate this tables with data:

lstraFields = Split(lstrInvalidDoc, "||")

For lnIndexFields = 0 To UBound(lstraFields)
lstrField = lstraFields(lnIndexFields)

With doc.Bookmarks(pstrTableName).Range.Tables(1)
.Cell(.Rows.Count, lnIndex).Range = lstrField
End With
Next

But somehow due to this insertion of the cell the mailmerge stops after two
records. If I remove the insertion of the cell and then loop through the code
with breakpoints, all records are processed.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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 :)
 
J

Jeroen

Hi Cindy

I've tried to set Execute to False, but then only one record seems to be
merged and it creates a second blank page...

I'm really stuck on this issue, so I hope you've got some more ideas.

Jeroen Walstra
 

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