Page 1 of 1

Read the MSword file form PHP and display in browser

Posted: Tue May 06, 2008 5:25 am
by raveendran
Hai,

I would like to read the MSword file(.doc) and display on the browser.

I used the following lines to read

$filename = "c:\\sample.doc";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));

but it showed me in the some other format.

Afterwards i google it,i found that i have to use

$word = new COM("word.application");

I couldn't found not good examples for reading the msword file by using the COM.

Can any one help me to fix this issues.

Thanks

Re: Read the MSword file form PHP and display in browser

Posted: Tue May 06, 2008 6:23 am
by DeFacto
Hi raveendran,

ive been looking for that as well, but all i could find that it is not possible, because of coding issuses.