Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: find and replace text in header and footers of MS Office doc and excel

by Corion (Patriarch)
on Oct 11, 2016 at 15:19 UTC ( [id://1173739]=note: print w/replies, xml ) Need Help??


in reply to Re^3: find and replace text in header and footers of MS Office doc and excel
in thread find and replace text in header and footers of MS Office doc and excel

Did you know that you can easily convert Visual Basic to Perl by basically replacing every Foo.Bar in the VB code with $Foo->Bar in the Perl code?

Replies are listed 'Best First'.
Re^5: find and replace text in header and footers of MS Office doc and excel
by Anonymous Monk on Oct 11, 2016 at 15:52 UTC
    Didn't know that - thanks again
Re^5: find and replace text in header and footers of MS Office doc and excel
by jjap28 (Initiate) on Oct 27, 2016 at 17:37 UTC

    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});

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1173739]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-24 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found