Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Ricki Miles Ricki Miles is offline
external usenet poster
 
Posts: 50
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
'Tools-Language-Set Language-Do not check spelling or grammar' does not work on the entire document john gibb Formatting Long Documents 10 May 16th 23 02:52 PM
Macro for changing language settings for exsisting docs 75coupe Microsoft Word Help 1 January 12th 07 05:08 AM
Macro For Merge and Filter Bob Collin Mailmerge 5 September 19th 06 02:21 AM
Word 2003: Tools/Language/Set Language English (U.S.) jargopotter Microsoft Word Help 1 April 25th 06 04:36 PM
"Macro Language Disabled" in Word 2003 tried reinstalling-no luc. Bobcat Microsoft Word Help 2 February 5th 05 10:29 PM


All times are GMT +1. The time now is 08:21 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"