Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
medix
 
Posts: n/a
Default Extracting meta-data from Active Directory (AD) via mailmerge

Hi,

I want to be able to use mail-merge in Word and pull the data for userinfo
e.g. Address, Contact telephone, Job designation,etc as stored in the AD and
present it
as a field for ultimate mail-merge.

Most users fail to populate the Userinfo in Word.

Any help greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default Extracting meta-data from Active Directory (AD) via mailmerge

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 stroing 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.
Peter Jamieson



"medix" wrote in message
...
Hi,

I want to be able to use mail-merge in Word and pull the data for userinfo
e.g. Address, Contact telephone, Job designation,etc as stored in the AD
and
present it
as a field for ultimate mail-merge.

Most users fail to populate the Userinfo in Word.

Any help greatly appreciated.





  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Medix
 
Posts: n/a
Default Extracting meta-data from Active Directory (AD) via mailmerge

Peter,

I was looking at it from the POV of getting some ADSI data corresponding to
the individual/login name of the person doing the merge.

It is worth investigating and thanks for putting me on the right track.

Regards,

"Peter Jamieson" wrote:

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 stroing 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.
Peter Jamieson



"medix" wrote in message
...
Hi,

I want to be able to use mail-merge in Word and pull the data for userinfo
e.g. Address, Contact telephone, Job designation,etc as stored in the AD
and
present it
as a field for ultimate mail-merge.

Most users fail to populate the Userinfo in Word.

Any help greatly appreciated.






Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel as mailmerge data source Mary Ann Mailmerge 2 December 6th 05 07:10 PM
Mailmerge chooses wrong data language jco Mailmerge 1 November 25th 05 03:12 PM
MailMerge Data Sources Bill S. Mailmerge 1 January 8th 05 11:07 AM
Mailmerge data source in an Access database will not open Colin C Mailmerge 3 December 31st 04 01:01 AM
Mailmerge wont see Added Excel Data source Columns Thatdampwood Mailmerge 3 December 2nd 04 11:56 PM


All times are GMT +1. The time now is 09:13 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"