# I ran into this problem today and found some helpful code snippets here. # However, I use Word 97 and there is a bug in the program which prevented # files from being saved. I found the workaround in the ActiveState # documentation. I thought people might find the code snippet helpful: ############################### # Convert incoming word file to plain text # USAGE: a full path file name needs to be provided # eg c:\\dir\\file.doc use constant TRUE => 1; use constant FALSE => 0; sub WordToText { my( $infile, $outfile) = @_; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Word'; $Win32::OLE::Warn = 3; # die on errors... my $Word = Win32::OLE->GetActiveObject('Word.Application') || Win32::OLE->new('Word.Application', 'Quit'); my $WordFile = $Word->Documents->Open("$infile"); if(!$WordFile) { print "WordToText did not create WordFile object\n"; undef $Word; return FALSE; } $Word->{Visible} = FALSE; $Word->WordBasic->FileSaveAs( $outfile, 2); # '2' is text $WordFile->Close( ); undef $WordFile; undef $Word; return TRUE; }