In order to run Graham's macro successfully, you will probably need to
apply the registry change described in
http://support.microsoft.com/kb/825765/en-us
For each document, if the data source no longer exists, you will not be
able to get any information about it by opening the .doc, because Word
will force you to discard the data source or provide another one. After
that, VBA will not let you see the details of the old data source.
For documents with other formats such as .docx/.docm (Word 2007), and in
some cases, .rtf, .xml, .html, you may be able to find the data source
details by opening the files outside Word - e.g. you can open .rtf, .xml
and .htm in Notepad. .docx and .docm files can be renamed to .zip and
the internal .xml files examined.
If all these documents connected to a .mdb which has now gone, or which
does not have the same query/table names in it, your task will be made a
lot easier if you can restore the old .mdb temporarily. If you do that,
I strongly recommend that you extract the following pieces of
information for each data source:
oDoc.MailMerge.DataSource.Name
oDoc.MailMerge.DataSource.Connectstring
oDoc.MailMerge.DataSource.Querystring
It wouldn't do any harm to extract
oDoc.MailMerge.DataSource.Tablename
either.
The chances are that all the mail merge main documents that connect to
your Access database have the same or similar COnnectstring, but if for
some reason, some connections needed to use the DDE method (e.g. because
they reference parameter queries), each connection string will be different.
The querystring will typically be something like
SELECT * FROM `tablename`
but if the user (or programmer) has set up any sort/filter criteria, the
Querystring embodies those criteria and will help you set up the mail
merge main document with the new table name and the same criteria.
Peter Jamieson
http://tips.pjmsn.me.uk