http://qs321.pair.com?node_id=424054


in reply to Run the word macro by using Win32::OLE

I don't really understand the connection between your example code and the question for running a macro. However the second part of your example should be written like:

my $range = $word->ActiveDocument->Content; $range->Find->Execute( { FindText => 'google.com', ReplaceWith => '<web>google.com</web>', Replace => $const->{'wdReplaceAll'}, } );

This code is however untested.

HTH