I want to read a Word document in a browser using PHP. I have been trying for more than two hours, but I cant get it to work. Can someone help me do this?
As your not too detailed in your question on your specific requirements or server setup, this will get you started & also answers the question.
Visible = 0;
//Open up an empty document
$wordDocument = $word->Documents->Open($DocumentPath);
//Create the filename for the HTML version
$HTMLPath = substr_replace($DocumentPath, 'html', -3, 3);
//Save the document as HTML
$wordDocument->SaveAs($HTMLPath, 3);
// clean up
$wordDocument = null;
$word->Quit();
$word = null;
// read the newly-created document
readfile($HTMLPath);
//delete the file
unlink($HTMLPath)
?>