Mail-merging with Word, MySQL... and Perl?



I'm trying to do a mail-merge in Microsoft Word 2003 using an ODBC connection to my MySQL database on my Linux box. The finished product will be a paper name/address/phone/etc. directory for our church. Normally this would work fine, except I don't want to just simply grab and merge the data from certain fields in the database. I need to be able to insert some programming logic.

For instance, I'll want to look at the age of the children listed in the database, and if they're older than (say) 18, I won't display their birthday. Or if a couple has its anniversary listed, I'll want to format that in BOLD and display it. Or if the listed person is a member, I'll want to format their name in a slightly different way. etc. etc. All of which is a little much for SQL to handle (or at least for *me* to handle in SQL).

For a normal project, this would be a simple job for Perl. What I can't figure out is, is there anyway to insert Perl into this mail-merge process? Obviously MS-Word wants to query a database over ODBC, not a Perl script. Is there a way to change that so Word will get its data from the Perl script directly (which would be written to generate that data in whatever format Word is looking for it?)

Thanks to anyone who can help!
.



Relevant Pages

  • Re: Mail-merging with Word, MySQL... and Perl?
    ... Alt+F9 to toggle off their display. ... connection to my MySQL database on my Linux box. ... Or if a couple has its anniversary listed, I'll want to format ... the Perl script directly (which would be written to generate that data in ...
    (microsoft.public.word.mailmerge.fields)
  • Re: DBI with ORACLE encryption
    ... perl script to pull data out of the interface and dump the same to the ... All we do with oracle is to take an database connection ... other ways of connecting to database using dbi. ...
    (perl.dbi.users)
  • Memory fault(coredump) with two DBD type connections
    ... successfully connect to Oracle databases via a Perl script. ... can successfully connect to DB2 databases via a Perl script. ... when I try to connect to the same Oracle database AND same DB2 database ... 27203 Allow compiling swigged C++ code ...
    (perl.dbi.users)
  • perl with mysql which takes a file as a input that contains t he info to create the tables
    ... inserting values into the database. ... only procedure for taking input from a file (using perl script) into ... MySQL database is through place holders. ... Where the passlist.txt hav the data in the format ...
    (perl.beginners)
  • Re: connect to a remote Postgresql server using DBI
    ... else) to execute queries on the remote database. ... perl script to execute queries on the remote server? ... > See the bottom of this page for client installation ...
    (perl.dbi.users)

Loading