Edit SQL String in Mail Merge

E

Epoh Rio

How can I edit the SQL string "SELECT * ..." to filter recipients in a
mail merge
using Excel as the Data Source.
 
P

Peter Jamieson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top