Bobro Posted September 7, 2009 Share Posted September 7, 2009 Hello, 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 <?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; ?> Fatal error: Call to undefined method variant::SaveAs() or Fatal error: Call to undefined method variant::Quit() Also tried $content = (string) $word->ActiveDocument->Content; echo $content; And various stuff with $word->ActiveDocument $word->Documents[1] $word->Documents[0] $word->Documents All i'm getting is function not found or an infinite time loop until i kill the word process... Link to comment https://forums.phpfreaks.com/topic/173459-reading-word-2007-files/ Share on other sites More sharing options...
Bobro Posted September 8, 2009 Author Share Posted September 8, 2009 Anyone? Link to comment https://forums.phpfreaks.com/topic/173459-reading-word-2007-files/#findComment-915101 Share on other sites More sharing options...
Bobro Posted September 10, 2009 Author Share Posted September 10, 2009 Php + Word = DEATH... Link to comment https://forums.phpfreaks.com/topic/173459-reading-word-2007-files/#findComment-916066 Share on other sites More sharing options...
Bobro Posted September 13, 2009 Author Share Posted September 13, 2009 Thanks a lot for not replying everyone... Switched to TXT files. Link to comment https://forums.phpfreaks.com/topic/173459-reading-word-2007-files/#findComment-917779 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.