karavay has asked for the wisdom of the Perl Monks concerning the following question:
if ( $file =~ /\.doc$/i ) { my $filename = $dir . "/docs/" . $file; $filename =~ s'/'\\' ; # invert slashes otherwise SaveAs cannot proce +ss the path correctly!!! my $savename = $dir . "/txt/" . $file . ".htm"; $savename =~ s/.doc//; print "Starting word\n"; my $Word = Win32::OLE->new( 'Word.Application', 'Q +uit' ); $Word->{Visible} = 0; my ($doc) = $Word->Documents->Open($filename) or die( "Unable to open document ", Win32::OLE->LastError() ); $doc->SaveAs( { FileName => $savename, FileFormat => wdFormatDOSTextLineBreaks } ); #FileFormat => wdFormatUnicodeText });#unicode s +upport print "Closing document and Word\n"; $Word->ActiveDocument->Close(); $Word->Quit; $b++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: win32::ole - SaveAs( )
by vkon (Curate) on Oct 01, 2007 at 16:54 UTC | |
by karavay (Beadle) on Oct 01, 2007 at 17:10 UTC | |
by vkon (Curate) on Oct 01, 2007 at 17:28 UTC | |
by karavay (Beadle) on Oct 01, 2007 at 17:46 UTC | |
by karavay (Beadle) on Oct 01, 2007 at 17:43 UTC | |
by vkon (Curate) on Oct 01, 2007 at 18:06 UTC | |
|