/ Published in: PHP
URL: http://www.gsdesign.ro/blog/extracting-text-from-word-documents-in-php-with-com-objects/
Use this PHP script to read and convert a Word document to a text file
Expand |
Embed | Plain Text
$filename="file.doc"; $TXTfilename = $filename . ".txt"; $word->Documents->Open($filename); // the '2' parameter specifies saving in txt format $word->Documents[1]->SaveAs($TXTfilename ,2); $word->Documents[1]->Close(false); $word->Quit(); $word->Release(); $word = NULL;
Comments
Subscribe to comments
You need to login to post a comment.

How do i save as a unicode txt file. I am working in a project where i need to convert chinese words docs into txt