ksamir2004 Posted May 7, 2008 Share Posted May 7, 2008 Hi All, can any one help me to creating word doc using php script. Requirement i have created Text editor. but what ever content we i can create in text editor it should save in word document. i am sending php script to you.. this is static but i want to save dynamic contents. <?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("text1.doc"); //closing word $word->Quit(); //free the object $word = null; ?> please send code or Advice me on this is highly appreciated. Regards, Sam Link to comment https://forums.phpfreaks.com/topic/104508-craete-word-doc-using-php-script/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.