This is a simple example of searching and replacing case sensitive text in a MS Word document. Use a loop to handle multiple docs.
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;
|