gopalr has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
Pls. guide me that how to run the MS-Word Macro by using Win32::OLE.
I get word object and find the pattern and replace it.
use OLE; use Win32::OLE::Const 'Microsoft Word'; my $const=Win32::OLE::Const->Load("Microsoft Word 9.0 Object Library") +; $word=GetObject OLE("Word.Application"); $word->Selection->HomeKey({unit=>$const->{'wdStory'}}); $word->Selection->Find->{'Text'}='google.com'; $word->Selection->Find->Replacement->{'Text'}='<web>google.com</web>'; $word->Selection->Find->Execute({Replace=>$const->{'wdReplaceAll'}});
I have a macro name called 'Macro1'. How to run this macro by using OLE.
Thanks in Advance
Gopal.R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Run the word macro by using Win32::OLE
by wfsp (Abbot) on Jan 21, 2005 at 09:55 UTC | |
|
Re: Run the word macro by using Win32::OLE
by guha (Priest) on Jan 21, 2005 at 16:51 UTC |