use Win32::OLE; use Win32::OLE::Const 'Microsoft Word'; $word = Win32::OLE->GetActiveObject('Word.Application') || Win32::OLE->new('Word.Application'); $mydoc = $word->Documents->Open($xfile); $word->Run("tskedfmt"); ($xfn) = $xfile =~ m/(.*)\.txt$/; $xfn .= "\.doc"; $mydoc->SaveAs(FileName => "$xfn", FileFormat => wdFormatDocument); $word->{Visible} = 1;