use strict; use warnings; use Win32::OLE::Const 'Microsoft Word'; $Win32::OLE::Warn = 1; my $word = Win32::OLE->new("Word.Application"); $word->{DisplayAlerts} = 0; $word->{Visible} = 0; my $doc = $word->Documents->Open("\\YOUR\\PATH\\TO\\FILE"); my $selection = $doc->Content->Find; $selection->{Text} = "hippopotamus"; $selection->{Replacement}->{Text} = "elephant"; $selection->{MatchCase} = 1; $selection->Execute({Replace => wdReplaceAll}); $doc->SaveAs("\\YOUR\\PATH\\TO\\ALTEREDFILE"); $doc->Close; $word->Quit;
In reply to Re: Search and replace in multple MS Word documents
by hominid
in thread Search and replace in multple MS Word documents
by Wobbel
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |