Page 1 of 1
How to open and write a MS word Doc in PHP
Posted: Sat Oct 28, 2006 9:14 am
by dharprog
Hi,
How to open and fill MS Word and MS Excel template file and write it back into with new file name in PHp?
Thank You
Posted: Sat Oct 28, 2006 9:23 am
by Jade
You might find it easier to format the data with php (to the template specifications) and then export the data in the format you need, instead of worrying about opening templates and writing to them.
Posted: Sat Oct 28, 2006 1:11 pm
by wyrmmage
well, I believe that MS uses XML for all of its documents, so you're going to have to look at the XML structure and then fill in the tags appropriately; it's a bit of a big question to just ask for source code for

Posted: Sat Oct 28, 2006 2:35 pm
by brendandonhue
If you have Word/Excel installed you can use COM objects to manipulate them.
Posted: Sat Oct 28, 2006 3:54 pm
by feyd
XML is (only) supported in the newer flavors of Word/Excel. I wouldn't bank on everyone having them.
Personally, I would recommend using RTF and CSV respectively; even PDF if the documents don't need to be editable.
You can use PhpRtf library
Posted: Fri Jun 01, 2007 3:03 pm
by sinedas
My reply maybe is too late. You can use PhpRtf library for creating rtf documents. The address there you can download sourses is
http://www.phprtf.com.