Hi, this can help you...
use OLE; use Win32::OLE::Const 'Microsoft Word'; my $const = Win32::OLE::Const->Load("Microsoft Word 9.0 Object Library +"); # 9.0 for word2000, 11.0 for word2003 or XP $word=GetObject OLE("Word.Application"); ### To access the active + Word Document $word->Selection->HomeKey ({unit=>$const->{'wdStory'}}); &WordReplaceAll('find', 'replace'); sub WordReplaceAll { my($FindText,$ReplaceText)=@_; for ($word->Selection->Find) { $_->{'Text'} = $FindText; $_->Replacement->{'Text'} = $ReplaceText; $_->Execute ({Replace=>$const->{'wdReplaceAll'}}); } }
regards,
Franklin
Don't put off till tomorrow, what you can do today.
In reply to Re: Open Doc file
by l.frankline
in thread Open Doc file
by kanish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |