View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Edit SQL String in Mail Merge

You can't do it directly in the Word user interface - you need to use Word
VBA either to set the value of
ActiveDocument.MailMerge.DataSource.QueryString to the SQL you want, or
(more reliable) use the VBA OpenDataSource method to re-open the data source
with the appropriate filename, connection string and SQL. Precisely how to
do that depends on the version of Word and the connection method you need to
use but you will find plenty of examples by search this group in Google
Groups (e.g. look for Peter Jamieson Excel opendatasource)

Peter Jamieson
"Epoh Rio" wrote in message
ups.com...
How can I edit the SQL string "SELECT * ..." to filter recipients in a
mail merge
using Excel as the Data Source.