View Single Post
Old 02-06-2009, 01:44 AM   #7 (permalink)
Tanax
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Quote:
Originally Posted by Wildhoney View Post
How are their tables typically laid out in the text files?
Like a basic table in word? There's a table tool in word that allows you to make a table.. Like that

Quote:
Originally Posted by sketchMedia View Post
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.
Based off of what I read on php.net about COM, that looks like it could work. However, I didn't find any info about saveAs function, and about the integer you pass with it either.. Where did you find that information?

Thanks!
__________________
Tanax is offline  
Reply With Quote