Converting MS Word document to html in php

html, ms-word, php

Solution

See the COM extension of PHP.

Example of the usage by the PHP site:

<?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;
?>

Problem

How can I convert a Microsoft Word document to html in php? I am using windows, and heard that the COM package does it.

Original source