I'm trying to read some .doc or .docx files or make any contact with word 2007 but so far i'm getting nothing, i tried to get it working even used the example code from php.net but it still refuses to work with word, i don't know why.
The example code from php.net
Code: Select all
<?php
// starting word
$word = new COM("word.application") or die("Unable to instantiate Word");
echo "Loaded Word, version {$word->Version}\n";
//bring it to front
$word->Visible = 1;
//open an empty document
$word->Documents->Add();
//do some weird stuff
$word->Selection->TypeText("This is a test...");
$word->Documents[1]->SaveAs("Useless test.doc");
//closing word
$word->Quit();
//free the object
$word = null;
?>or
Fatal error: Call to undefined method variant::Quit()
Also tried
Code: Select all
$content = (string) $word->ActiveDocument->Content;
echo $content;Code: Select all
$word->ActiveDocument
$word->Documents[1]
$word->Documents[0]
$word->Documents