[thelist] Microsoft Word mail merge using MySQL (and PHP?)

Christopher Mahan chris_mahan at yahoo.com
Wed Jan 21 20:08:59 CST 2004


--- Sarah Sweeney <poohbear at designshift.com> wrote:
> I'm about to start a project which involves moving a database from 
> Access to MySQL. The current Access database includes some reports
> which 
> are used to print mailing labels and contracts for clients, using
> client 
> info from the database. I'm wondering if it will be possible to do
> the 
> same kind of thing with a Microsoft Word mail merge, getting the
> data 
> directly from the MySQL database. Will I need to pass parameters to
> the 
> Word mail merge, or can I select certain records directly in Word?
> Also, 
> will PHP be required, or can this all be done directly from Word?

Option:
Use COM support in PHP (if available) to automate Word. Then use PHP
to access data in mySQL

Option2: 
Use COM support in Python, (it's available, I use it) to automate
Word, then use python to access records in mySQL.

Option3:
Use PHP to extract a CSV formatted text file of data out of mySQL and
use that with Word's built-in mail merge wizard.

Option4: 
Install ODBC driver on machine with Word and establish connection
with mySQL via DSN in Mailmerge wizard. PHP not required.

Option5:
Use php/python to COM into Access and dump records from mySQL into
Access table, then have Word pull data from access using existing
method. This option is good if you do not want to mess with existing
mail merge setup.




=====
Christopher Mahan
chris_mahan at yahoo.com
818.943.1850 cell
http://www.christophermahan.com/

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/


More information about the thelist mailing list