Return to Snippet

Revision: 8306
at September 12, 2008 08:56 by jonhenshaw


Initial Code
$word = new COM("word.application") or die ("Could not initialise MS Word object.");
$word->Documents->Open(realpath("Sample.doc"));
// Extract content.
$content = (string) $word->ActiveDocument->Content;
echo $content;
$word->ActiveDocument->Close(false);
$word->Quit();
$word = null;
unset($word);

Initial URL
http://www.developertutorials.com/blog/php/extracting-text-from-word-documents-via-php-and-com-81/

Initial Description
Requires an insecure, I mean Windows server (doh!)

Initial Title
Extracting text from Word Documents via PHP and COM

Initial Tags


Initial Language
PHP