Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Macro language for filter
I am creating a Word XP macro to create an automated mail merge. I need the
merge to happen only for reocords with an exact match to a certain field (example DEPT = 3). After I record the macro choosing to filter on the field during the merge, the language in the macro does not mention the nature of the match. What is the proper macro language to make this happen? TIA, Ricki |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Macro language for filter
If you define a filter in the MailMerge Recipients dialog or its "advanced"
facility, Word actually "translates" your filter specifications into an SQL SELECT statement. Precisely how it does it depends on which dialect of SQL it thinks it needs to use. But toset up the filter in code, a. find out the SQL that WOrd is using (e.g. look at the value of ActiveDocument.MailMerge.DataSource.QueryString) b. either set ActiveDocument.MailMerge.DataSource.QueryString to have the value you need or c. set the valuein a cal to OpenDataSource (you may have to do it this way if you cannot use approach (b). -- Peter Jamieson http://tips.pjmsn.me.uk "Ricki Miles" wrote in message ... I am creating a Word XP macro to create an automated mail merge. I need the merge to happen only for reocords with an exact match to a certain field (example DEPT = 3). After I record the macro choosing to filter on the field during the merge, the language in the macro does not mention the nature of the match. What is the proper macro language to make this happen? TIA, Ricki |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
'Tools-Language-Set Language-Do not check spelling or grammar' does not work on the entire document | Formatting Long Documents | |||
Macro for changing language settings for exsisting docs | Microsoft Word Help | |||
Macro For Merge and Filter | Mailmerge | |||
Word 2003: Tools/Language/Set Language English (U.S.) | Microsoft Word Help | |||
"Macro Language Disabled" in Word 2003 tried reinstalling-no luc. | Microsoft Word Help |