Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Jeroen Jeroen is offline
external usenet poster
 
Posts: 3
Default Mailmerge processes only 2 records

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
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Cindy M -WordMVP- Cindy M  -WordMVP- is offline
external usenet poster
 
Posts: 370
Default Mailmerge processes only 2 records

Hi ?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 :-)

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Jeroen Jeroen is offline
external usenet poster
 
Posts: 3
Default Mailmerge processes only 2 records

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

"Cindy M -WordMVP-" wrote:

Hi ?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 :-)


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mailmerge from Access parameter query only merges odd records helios Mailmerge 5 December 30th 05 11:24 AM
Help! Mailmerge code for all selected records? Kara Mailmerge 1 October 12th 05 07:05 PM
Included Property in Word 2003 MailMerge Alessio Mailmerge 1 December 23rd 04 11:26 AM
How do I get multiple Access records into a single mailmerge lett. Wiley W. Mailmerge 1 December 18th 04 04:47 PM
mailmerge records missing at pageskip FnijkampNL Mailmerge 1 November 30th 04 12:31 AM


All times are GMT +1. The time now is 01:48 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"