Without using Format/Style, the text in the body of the Word doc is being replaced, but footnotes are not. So, I am being specific to the footnote. Is there something wrong with this code?
$selection = $word->ActiveDocument->Content; $selection->Find->ClearFormatting; $selection->Find->{Style} = $word->ActiveDocument->Styles("Footnote Te +xt"); $selection->Find->Replacement->ClearFormatting; $selection->Find->Replacement->{Style} = $word->ActiveDocument->Styles +("Footnote Text"); $selection->Find->{Text} = "Software"; $selection->Find->Replacement->{Text} = "SW"; $selection->Find->{Wrap} = wdFindContinue; $selection->Find->{Format} = 'True'; $selection->Find->{MatchCase} = 'False'; $selection->Find->{MatchWholeWord} = 'False'; $selection->Find->{MatchWildcards} = 'False'; $selection->Find->{MatchSoundsLike} = 'False'; $selection->Find->{MatchAllWordForms} = 'False'; $search_res = $selection->Find->Execute({Replace => wdReplaceAll});
In reply to Re^5: find and replace text in header and footers of MS Office doc and excel
by jjap28
in thread find and replace text in header and footers of MS Office doc and excel
by jjap28
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |