Page 1 of 1

Php script to read msword file

Posted: Sat Oct 24, 2009 1:21 am
by rajsekar2u
hi,

I need to read a msword file and i want to print the contents in that word file.

i used the fgets() and its working for text file. but its not working for word file.

Help me in this.

Thanks in advance

Re: Php script to read msword file

Posted: Sat Oct 24, 2009 1:27 am
by guosheng1987
use com

$word = new COM("word.application") or die(" can not open com object");

more details use google

Re: Php script to read msword file

Posted: Sat Oct 24, 2009 6:13 am
by Mark Baker
COM will only work if your server is running on a Windows server, with MS Word installed.

You don't mention which version of Word. If it's word 2007, you could always look at PHPdocx for a pure PHP solution