in reply to Convert word(.doc) file to html file

Use Win32::OLE, should allow you to open a word doc and save it as a HTML file.

Should be easy enough, along the lines of,

use Win32::OLE;
use Win32::OLE::Const 'Microsoft.Word';

my $Word = Win32::OLE->new('Word.Application', 'Quit');
my $Doc = $Word->Documents->Open($File);

$Word->ActiveDocument->SaveAs( { Filename => $HTMLFile, FileFormat => wdFormatHTML } );


$Word->ActiveDocument->Close();
$Word->Close();

Where $File is the Word.doc file and $HTMLFile is the Word.html file
  • Comment on Re: Convert word(.doc) file to html file

Replies are listed 'Best First'.
Re^2: Convert word(.doc) file to html file
by Anonymous Monk on Mar 23, 2005 at 11:30 UTC
    I assume then that this can be automated if you supply all filenames etc in advance?