Page 1 of 1

php and mysql to do, and print, a mail merge in MS Word

Posted: Wed Mar 24, 2004 1:34 pm
by goldy
Hi...I would really appreciate some help on this.

What I've got is...
A mysql database driven by a php built web interface. The db has several tables, linked by a person's unique id. I have no problem pulling info from or putting info into the tables.

What I want to do is...
Create a link on a page to do a mail merge. (link is there) What I want the code to do is this...

1) Use a pre-typed MS Word document as a template.
2) Pull information from the mysql tables to fill in the template.
3) Print out the MS Word letter to a network printer (can be local)
4) Print out envelopes to a network printer (can be local)

Is this possible? Fairly Straight-forward? I really would like to automate this process because we have several hundred letters/envelopes and this process has taken a long time in the past. Please feel free to email me if you have any ideas. Thanks in advance for all of your help!

Posted: Wed Mar 24, 2004 2:14 pm
by malcolmboston
this is very possible but requires working with com objects also i believe it is only possible to do this if you are on a windows host (which most of the time isnt the case)

if you can get PHP to commuicate with word i see no reason not to do the other things you ask for

much easier to write it out in C mind

*edit*
me wrote: believe it is only possible to do this if you are on a windows host
yep i was right
PHP manual wrote: Requirements
COM functions are only available on the Windows version of PHP.