View Single Post
Old 02-06-2009, 12:57 AM   #6 (permalink)
sketchMedia
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

http://www.microsoft.com/com/default.mspx

You could do something like this, however I believe you will need word installed on your server!(help me out windows guys) which may or may not be possible, any who this is how you would do it (I think ).
PHP Code:
<?php
try
{
    
$sDoc realpath('word.doc');
    
$aPath pathinfo($doc);
    
$sName $aPath['filename'];

    
$pWordCOM = new COM("word.application");
    
$pWordCOM->Documents->Open('originalDoc.doc');
    
$pWordCOM->ActiveDocument->SaveAs($sName8); //8 is the number for htm ext
    
$pWordCOM->ActiveDocument->Close(false);
    
$pWordCOM->Quit();
    unset(
$pWordCOM);
}
catch(
Exception $e)
{
?>
    <h4>Error: </h4>
    <p><?php echo $e->getMessage(); ?></p>
    <br />
    <h4>Stack Trace</h4>
    <pre>
    <?php echo $e->getTraceAsString(); ?>
    </pre>
<?php
}
Basically uses COM to open word, then open the document, then saveAs htm.

Not tested btw.
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)

Last edited by sketchMedia : 02-06-2009 at 01:04 AM. Reason: typo
sketchMedia is offline  
Reply With Quote
The Following User Says Thank You to sketchMedia For This Useful Post:
Tanax (02-06-2009)