C
Chaplain Doug
Word 2003. I would like to use the MailMergeBeforeRecordMerge event with my
mailmerge document. How do I set this up so that it is triggered each time
before a new merge record is processed. I tried placing the exmaple code in
the code space for ThisDocument, but it does not work that way. The code is:
Private Sub MailMergeApp_MailMergeBeforeRecordMerge(ByVal Doc As Document,
Cancel As Boolean)
Static LastGolfer As String
Dim intZipLength As Integer, CurrentGolfer As String
intZipLength = Len(ActiveDocument.MailMerge.DataSource.DataFields(6).Value)
'Cancel merge of this record only if
'the zip code is less than five digits
If intZipLength < 5 Then
Cancel = True
End If
End Sub
mailmerge document. How do I set this up so that it is triggered each time
before a new merge record is processed. I tried placing the exmaple code in
the code space for ThisDocument, but it does not work that way. The code is:
Private Sub MailMergeApp_MailMergeBeforeRecordMerge(ByVal Doc As Document,
Cancel As Boolean)
Static LastGolfer As String
Dim intZipLength As Integer, CurrentGolfer As String
intZipLength = Len(ActiveDocument.MailMerge.DataSource.DataFields(6).Value)
'Cancel merge of this record only if
'the zip code is less than five digits
If intZipLength < 5 Then
Cancel = True
End If
End Sub