kanish has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I can able to open a doc file and find the text.
Problem is how to replace it.
use strict; use Win32::OLE; use Win32::OLE::Const 'Microsoft Word'; my $word = Win32::OLE->new('Word.Application'); $word->{Visible} = 1; my $document=$word->Documents->Open('c:/temp/test.doc'); $word->Selection->HomeKey(wdStory); $word->Selection->Find->{'Text'}='Some Text'; $word->Selection->Find->Replacement->{'Text'}='Replaced Text'; $word->Selection->Find->Execute(); ### Need help here
Thanks,
Kanishk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replace word in Win32::OLE
by l.frankline (Hermit) on Jan 06, 2006 at 07:04 UTC | |
|
Re: Replace word in Win32::OLE
by gopalr (Priest) on Jan 06, 2006 at 07:21 UTC | |
|
Re: Replace word in Win32::OLE
by gube (Parson) on Jan 06, 2006 at 07:24 UTC | |
|
Re: Replace word in Win32::OLE
by Anonymous Monk on Jan 06, 2006 at 10:55 UTC |