A Microsoft Word forum. Microsoft Office Word Forum - WordBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Microsoft Office Word Forum - WordBanter forum » Microsoft Word Newsgroups » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to Setup an Event Processor



 
 
Thread Tools Display Modes
  #1  
Old December 29th 05, 05:18 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default How to Setup an Event Processor

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

--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org
Ads
  #2  
Old December 30th 05, 10:20 AM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default How to Setup an Event Processor

It sounds like you might be using a hammer to crack a nut. You may be able
to do what you want by using the Skip Record If field, checking for the
value of the sixth data field.

However, see the "Individual Merge Letters" item on fellow MVP Graham Mayor's
website at:

http://www.gmayor.com/individual_merge_letters.htm

If you are using Word XP or later, the "Add-in to Merge Letters to Separate
Files" that I have written and that can be downloaded from that site will
allow you to create each letter as a separate file with a filename taken
from a field in the data source with a minimum of fuss.

If you study all of the code in that add-in you may get an idea how to get
the event processor to work.

Note, you will also need to have followed the information in the article
"Writing application event procedures" at:

http://www.word.mvps.org/FAQs/Macros...lassEvents.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Chaplain Doug" wrote in message
...
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

--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I setup a template for Avery 5366 file folder labels? Gingia Microsoft Word Help 2 March 31st 22 11:03 AM
Footer Margins in Page Setup Tami Page Layout 2 June 23rd 05 04:35 PM
different page setup for sections ile Page Layout 3 June 21st 05 10:31 AM
Page Setup Window Dodger Jim Page Layout 1 June 6th 05 10:17 PM
Event firing for Word Raj Microsoft Word Help 1 February 4th 05 07:23 AM


All times are GMT +1. The time now is 11:37 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Copyright 2004-2022 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.