View Single Post
  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Problem with MailMergeBeforeRecordMerge with Labels Avery A4 a

I don't know of any way to change the behaviour of these events.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Claudiu Toma" wrote in message
...
I have an ActiveX control in each label box that draws a barcode based on
the
value of the field in the current label.
But since the event fires at the end of each page, I only get the 8th,
16th,
and 17th record (as I have 8 labels per page).

I want to be able to catch an event when each label is record merged, like
that I can set the value of the ActiveX control
and draw a barcode corresponding to the value of the current record.

Example: with a data source of serial numbers I want to create a mail
merge
with 8 labels per page (Avery A4 and A5 Sizes)
and print my serial numbers 8 SN# per page.


"Peter Jamieson" wrote:

As you have discovered the event doesn't fire for each record. It fires
when
Word starts making a new copy of the Mail Merge data source.

You might be better off "rolling your own merge" in this case - as long
as
you know what the data source is going to be, you may be able to use ADO
to
read the records, for example, and populate the labels another way.
--
Peter Jamieson
http://tips.pjmsn.me.uk

"Claudiu Toma" Claudiu wrote in message
...
I've started a mail merge, using Labels as layout selecting Avery A4
and
A5
sizes which renders 8 labels on a page. In each label I display the
value
of
a field (same for all labels).

Why MailMergeBeforeRecordMerge event fires only 3 times, when I have 17
records in the data source. It looks like it fires every 8th record in
the
data source as there are 8 labels on a page, and printing the full mail
merge
of my 17 records prints 3 pages to the printer

I used the sample VBA MailMerge code provided from
http://support.microsoft.com/kb/285333

This is the proof that MailMergeBeforeRecordMerge fired only for
record
#8,
#16, #17

Is there a workaround this? to be able to get the event for every
record.

I want to draw something in each label box based on the value of the
current
record. It's basically a mail merge with labels, 8 labels per page, and
using
a data source I have different values in each label, as the «Next
Record»
tag
in each label instructs the Mail Merge wizard to proceed to the next
record.

Any ideas?
Thanks,

Output of my Immediate Window in VBA Editor:
STARTS HERE
MailMergeWizardStateChange Event
- Starting Step 1 (Select document type)
MailMergeWizardStateChange Event
- Starting Step 2 (Select starting document)
MailMergeWizardStateChange Event
- Starting Step 1 (Select document type)
MailMergeWizardStateChange Event
- Starting Step 2 (Select starting document)
MailMergeWizardStateChange Event
- Starting Step 3 (Select Recipients)
MailMergeDataSourceLoad Event
- Table : SELECT * FROM C:\Documents and
Settings\ctoma\Desktop\TestMailMerge\STICKER.TAB
- Query String: SELECT * FROM C:\Documents and
Settings\ctoma\Desktop\TestMailMerge\STICKER.TAB
- Field Names :
CUST_NO,ROUTE,SEQ,FIELD_NO,STATION_NO,STATION_SUFF ,CUST_NAME,FIELD_NAME,STATION_NAME,CUSTFLDSTA,METE R_TYPE,STAT_RANGE,DIFF_RANGE,ROTATION,ROT_UNITS,AB S_OR_GAUGE,TUBE,PLATE,COEFF,GEAR_RATIO,METER_NO,AP I,GRAVITY,DISTRIB_NO,ATMOS_PRESS,STATION_ID,LOW_TE MP,HIGH_TEMP,DEFAULT_TEMP,PAD_STATION_NO,PAD_CFSS, API_OR_MASTER,DIFF_STAT_TEXT,TEMP_RANGE_TEXT,TUBE_ PLATE_TEXT,EFFECTIVE_DATE,MASTER_DATE,TIME_STAMP
MailMergeWizardStateChange Event
- Starting Step 4 (Write Your Letter)
MailMergeWizardStateChange Event
- Starting Step 5 (Preview Your Letters)
MailMergeDataSourceLoad Event
- Table : SELECT * FROM C:\Documents and
Settings\ctoma\Desktop\TestMailMerge\STICKER.TAB
- Query String: SELECT * FROM C:\Documents and
Settings\ctoma\Desktop\TestMailMerge\STICKER.TAB
- Field Names :
CUST_NO,ROUTE,SEQ,FIELD_NO,STATION_NO,STATION_SUFF ,CUST_NAME,FIELD_NAME,STATION_NAME,CUSTFLDSTA,METE R_TYPE,STAT_RANGE,DIFF_RANGE,ROTATION,ROT_UNITS,AB S_OR_GAUGE,TUBE,PLATE,COEFF,GEAR_RATIO,METER_NO,AP I,GRAVITY,DISTRIB_NO,ATMOS_PRESS,STATION_ID,LOW_TE MP,HIGH_TEMP,DEFAULT_TEMP,PAD_STATION_NO,PAD_CFSS, API_OR_MASTER,DIFF_STAT_TEXT,TEMP_RANGE_TEXT,TUBE_ PLATE_TEXT,EFFECTIVE_DATE,MASTER_DATE,TIME_STAMP
MailMergeDataSourceLoad Event
- Table : SELECT * FROM C:\Documents and
Settings\ctoma\Desktop\TestMailMerge\STICKER.TAB
- Query String: SELECT * FROM C:\Documents and
Settings\ctoma\Desktop\TestMailMerge\STICKER.TAB
- Field Names :
CUST_NO,ROUTE,SEQ,FIELD_NO,STATION_NO,STATION_SUFF ,CUST_NAME,FIELD_NAME,STATION_NAME,CUSTFLDSTA,METE R_TYPE,STAT_RANGE,DIFF_RANGE,ROTATION,ROT_UNITS,AB S_OR_GAUGE,TUBE,PLATE,COEFF,GEAR_RATIO,METER_NO,AP I,GRAVITY,DISTRIB_NO,ATMOS_PRESS,STATION_ID,LOW_TE MP,HIGH_TEMP,DEFAULT_TEMP,PAD_STATION_NO,PAD_CFSS, API_OR_MASTER,DIFF_STAT_TEXT,TEMP_RANGE_TEXT,TUBE_ PLATE_TEXT,EFFECTIVE_DATE,MASTER_DATE,TIME_STAMP
MailMergeWizardStateChange Event
- Starting Step 6 (Complete the Merge)
MailMergeBeforeRecordMerge Event
MailMergeAfterRecordMerge Event
- Processed Record # 8
MailMergeBeforeRecordMerge Event
MailMergeAfterRecordMerge Event
- Processed Record # 16
MailMergeBeforeRecordMerge Event
MailMergeAfterRecordMerge Event
- Processed Record # 17
MailMergeAfterMerge Event
- Record Count: -1
- New Document: Labels1
MailMergeBeforeRecordMerge Event
MailMergeAfterRecordMerge Event
- Processed Record # 8
MailMergeBeforeRecordMerge Event
MailMergeAfterRecordMerge Event
- Processed Record # 16
MailMergeBeforeRecordMerge Event
MailMergeAfterRecordMerge Event
- Processed Record # 17
MailMergeAfterMerge Event
- Record Count: -1
MailMergeWizardSendToCustom Event
- Custom Processing Cancelled
MailMergeBeforeMerge Event
- Proceeding with Mail Merge
MailMergeWizardSendToCustom Event
- Proceed with Custom Processing
MailMergeBeforeRecordMerge Event
MailMergeAfterRecordMerge Event
- Processed Record # 8
MailMergeBeforeRecordMerge Event
MailMergeAfterRecordMerge Event
- Processed Record # 16
MailMergeBeforeRecordMerge Event
MailMergeAfterRecordMerge Event
- Processed Record # 17
MailMergeAfterMerge Event
- Record Count: -1
- Sent MailMerge results to the Browser

ENDS HERE