Currently, my system generates a HTML document based on the values passed and retrieves the contents of the documents from MySQL database.
Instead of HTML document, I want to generate an ms WORD document containing the same contents that the HTML document has.
Can any of you give me some help or recommendations?
So, i tried the code below..i pasted the whole thing just above the html code for the page I want to make into a WORD document.
$word = new COM("word.application") or die("Unable to start Ms Word");
$word->Visible = 0;
//$contents will be the string you want to convert to a Word document
$word->Documents->Add("$contents");
$word->Documents[1]->SaveAs("filename.doc");
$word->Quit();
$word->Release();
$word = null;
I tried the COM method but got this error:
Fatal error: Cannot instantiate non-existent class: com in /home/all/www/www/php4/refer/profile1.php