You mentioned that "the other approach has not been maintained"
referring to Word I suppose. Could you eloborate? I would like to
understand why Word would have worked perfectly for several months and
then
just quit! Could it be that some recent update to Office 2007 or the like
just stepped on the Mail Merge feature?
Lengthy and inconclusive response follows:
If you are not aware of changing anything relevant in Outlook, e.g. if you
have not for some reason marked your contacts folder as /not/ being in the
Outlook Address Book, or renamed the folder - stuff like that - then the
chances are that something has either broken for reasons I do not know, or
something has broken because of an update.
The method where you start from Word uses the Access/Jet OLE DB provider to
get the data. (Well, actually in Office 2007, the Jet datbase engine has
been modified and renamed so it is now called the ACE engine, and the
provider is now the ACE provider).
The Jet/ACE provider can maintain data in the Jet/ACE (.mdb) databases which
are if you like the native database format for Access, but also has addins
called IISAMs provided by Microsoft to get or maintain data in a number of
other formats, e.g. Excel, plain text, and some versions of dBASE. There is
also an IISAM to get data from Outlook and other address book providers.
This is what Word uses.
When I say "it hasn't been maintained", I mean two things:
a. it has never been modified so that it can retrieve all the outlook
contact fields that the "start from outlook" method can retrieve. For
example, it does not retrieve the "categories" fields, and it returns many
of the address fields in a different way and with different names than the
"start from Outlook" approach does
b. I don't get the impression that Microsoft invests any effort into making
this work any "better". For example, even if you use the OLE DB provider
from a VB or VBA program, specifying the contacts folder name you want, it
appears to be impossible to avoid a dialog box that lets the user select the
folder.
I heard (a long time ago) that one of the reasons for (a) might be that it
is actually quite difficult to get this data out of Outlook. I know some of
the reasons why that might be the case but probably not all of them. The
probable reason for (b) and quite possibly also for some of (a) is that
providing access via this route presents an additional "attack surface" for
viruses etc. that want to steal your address data.
This method has always seemed quite fragile - in other words, plenty of
people report the sort of problems you have encountered. Typically it's
easier to refer them to the "start from Outlook" approach because it (a)
seems to be "the future" and better supported, and allows access to more of
the contact data and (b) finding and fixing the cause of things that "just
break" is rarely easy in Windows/Office. You can always try the Office
detect and repair (it's calld something else in Office 2007), for example
but I personally do not like advising people to uninstall/reinstall Office.
As far as I can tell, some reasons why the Jet/ACE OLE DB approach might
fail are:
c. it uses a couple of temporary files - if it can't create them, the
operation will fail
d. the names of the Address book folders and the Contact folders are not
necessarily the same - for example if you select the properties for your
Outlook Contacts folder and look at the Outlook Address Book tab, you will
see that you do not have to specify "Contacts" in there also.
e. further, some of these folder/address book names do not seem to go away
even when you remove the contacts folder they are associated with. I've
never quite worked that one out but think the names must be held
independently somewhere.
If you haven't changed anything in Outlook, then (d) and (e) seem highly
unlikely, but a modification to Windows security might well cause problems
with (c). Here, for example, if I set up Outlook Contacts as my data source
and use VBA to show the data source's name property, connectionstring
property and querystring property I see:
name: C:\Program Files (x86)\Common
Files\SYSTEM\MSMAPI\1033\~~~_virtual_file_~~~Mailbox - Peter Jamieson|
connectstring: Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data
Source="";Mode=Share Deny None;Extended Properties="Outlook
9.0;MAPILEVEL=Mailbox - Peter
Jamieson|;TABLETYPE=0;DATABASE=C:\Users\PJJ~1.DOM\AppData\Local\Temp\OfficeMMergeTempDir\OLK1C56.tmp;COLSETVERSI
querystring: SELECT * FROM `Contacts`
In other words, Word is apparently trying to use a file in C:\Program Files
(x86)\Common Files\SYSTEM\MSMAPI\1033\ and a file in
C:\Users\PJJ~1.DOM\AppData\Local\Temp\OfficeMMergeTempDir
What if Windows has not allowed the OLE DB provider to create those files
and folders? It could be worth trying to have a look at the equivalent
folders on your system. FWIW in this case I am actually using Word 2007 with
Outlook 2003 on Vista 64-bit (and the connection currently works fine) - I
would expect something similar on Windows XP and with WOrd 2003, but it's
possible that something different happens when you use Word 2007 with
Outlook 2007.