This is my post from a couple of years ago on this subject - I can't say
I've looked at this area since then:
------------------------------
The last time I looked (about 2 years ago) it was possible to use the OLEDB
provider for the AD to use AD as a Word mailmerge data source. e.g. in code
ActiveDocument.MailMerge,OpenDataSource _
Name:="c:\a\empty.odc", _
Connection:="Provider=ADSDSOObject;", _
SQLStatement:="SELECT * FROM 'LDAP://adsiservername'"
where empty.odc is a completely empty file that you can create in e.g.
Notepad, and adsiservername is the name of the adsi server box.
However, I get the impression that what you want to do is either
a. get some ADSI data corresponding to the individual/login name of the
person doing the merge or
b. get some ADSI data appropriate to the data in each row in another data
source.
Either way, for the data to appear as a field in the data source, you would
have to be able to get the data source to do the ADSI query. If your data
source is Jet/Access, you /might/ be able to create a Query that could do
that, using a linked table perhaps - I don't know off the top of my head. If
your data source is something like SQL Server, you /might/ be able to do the
same using an attached table and a View.
Otherwise, if it's case (a), you could consider getting the data using ADO
in a Word VBA macro each time a merge is done, and either inserting the
results directly or storing them in a way that makes insertion relatively
simple, e.g. in a Document Property (insert using { DOCPROPERTY } field or
Document Variable (insert using { DOCVARIABLE } field.