It would certainly not be straightforward in the general case, because...
a. there are (at least!) four sets of criteria for including records
in a merge (ignoring the fact that you can also use { SKIPIF } fields to
ignore records in some types of merge), i.e.
- you choose a data source - a file, a table in a database, a
workbook/worksheet
- you filter using the dropdowns in Mail Merge Recipients (and/or
the form in "Query Options")
- you include/exclude individual records in Mail Merge Recipients
- you specify the start and finish data source record numbers when
you initiate the merge
b. When the user specifies criteria using the dropdowns or Query
options, from a programming perspective you don't get to see what the
user specified in those dropdowns. At best, what you get to see is the
SQL code that Word generated as a consequence of the user's choices. The
SQL generated depends partly on the type of data source - e.g., when the
data source is a Word document, Word uses a very smple built-in dialect
of SQL. If the data source is a Jet database, Word may use a Jet SQL
dialect.
If the user chose a different data source of the same type (e.g.
switched from one Access data source to another) maybe you could just
re-use the SQL WHERE clause or some such. But if the user chose a
different type of data source altogether, you would in effect have to
translate from one SQL dialect to another.
c. When the user selects individual records, you may find it difficult
to determine programmatically what they selected because the interface
is unreliable and may hang/crash Word (I forget the details, because the
interface is so unreliable there's not much point in remembering them,
but I 'll look again if you really insist)
i.e., broadly speaking, the more narrow the choices available to your
users, the simpler it would be to impose the same selection criteria
given a change of data source. If your users could choose any old data
source, things could be pretty hard, and perhaps in that case it might
be better to present your own selection criteria forms and generate your
own queries, etc. etc.
Peter Jamieson
http://tips.pjmsn.me.uk