Thread: Word Doc
View Single Post

  #3 (permalink)  
Old 05-09-2008
Narendra
 
Posts: n/a
Default Re: Word Doc

On May 8, 4:51*pm, "McKirahan" <N...@McKirahan.com> wrote:
> "Jes" <jesmondspit...@gmail.com> wrote in message
>
> news:b0e9cd59-6f0c-42d1-959e-32a1bcbf3b75@k37g2000hsf.googlegroups.com...
>
> > Hi
> > I am new to php and have a small project that I would like to
> > implement as my first try.
> > This involves a 'Home Page' with links to various Word Documents.

>
> > Is it possible to read the contents of the Word Document and place it
> > in a <textarea> or something similar instead of having the user
> > opening the Word every time ?

>
> First is MS-Word installed on the server?
>
> Why try to do it on the fly for each user?
>
> Why not just save each as a PDF file and/or
> as a text file and give your users the option
> to view/download in their desired format.




You can read the data of a .doc file and store it in a file and use
accordingly..

Check this function and use it enjoy...

function readmyfile($path){
$text='';
$fp = @fopen($path,"r+");
while (!@feof($fp)){
$buffer = @fgets($fp, 4096);
$text.= $buffer;
}
@fclose($fp);
return $text;
}
Reply With Quote