C
Claudiu Toma
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: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,METER_TYPE,STAT_RANGE,DIFF_RANGE,ROTATION,ROT_UNITS,ABS_OR_GAUGE,TUBE,PLATE,COEFF,GEAR_RATIO,METER_NO,API,GRAVITY,DISTRIB_NO,ATMOS_PRESS,STATION_ID,LOW_TEMP,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,METER_TYPE,STAT_RANGE,DIFF_RANGE,ROTATION,ROT_UNITS,ABS_OR_GAUGE,TUBE,PLATE,COEFF,GEAR_RATIO,METER_NO,API,GRAVITY,DISTRIB_NO,ATMOS_PRESS,STATION_ID,LOW_TEMP,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,METER_TYPE,STAT_RANGE,DIFF_RANGE,ROTATION,ROT_UNITS,ABS_OR_GAUGE,TUBE,PLATE,COEFF,GEAR_RATIO,METER_NO,API,GRAVITY,DISTRIB_NO,ATMOS_PRESS,STATION_ID,LOW_TEMP,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
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: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,METER_TYPE,STAT_RANGE,DIFF_RANGE,ROTATION,ROT_UNITS,ABS_OR_GAUGE,TUBE,PLATE,COEFF,GEAR_RATIO,METER_NO,API,GRAVITY,DISTRIB_NO,ATMOS_PRESS,STATION_ID,LOW_TEMP,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,METER_TYPE,STAT_RANGE,DIFF_RANGE,ROTATION,ROT_UNITS,ABS_OR_GAUGE,TUBE,PLATE,COEFF,GEAR_RATIO,METER_NO,API,GRAVITY,DISTRIB_NO,ATMOS_PRESS,STATION_ID,LOW_TEMP,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,METER_TYPE,STAT_RANGE,DIFF_RANGE,ROTATION,ROT_UNITS,ABS_OR_GAUGE,TUBE,PLATE,COEFF,GEAR_RATIO,METER_NO,API,GRAVITY,DISTRIB_NO,ATMOS_PRESS,STATION_ID,LOW_TEMP,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