gopalr has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I use the below to find the Text in Ms-Word File by using OLE.
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->Find->{'MatchWildcards'}=True; $word->Selection->Find->{'Text'}='\<web\>*\</web\>'; if ($word->Selection->Find->Execute) { ## $prematch=(15 characters only) ## $postmatch=(15 characters only) }
But I need to get the Pre-Match & Post-Match characters from Selection Text.
Pre-Match & Post-Match length only should be 15 characters.
Input File
This is Sample Pre Match Text<web>www.hotmail.com</web>This is Sample +Post Match Text
The following variables should contain like this
$prematch=' Pre Match Text'; $postmatch='This is Sample ';
Pls. help me how to get the length.
Thanks
Gopal.R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to get the Pre-Match and Post-Match
by CountZero (Bishop) on Feb 07, 2005 at 07:01 UTC | |
|
Re: How to get the Pre-Match and Post-Match through Win32::OLE
by gube (Parson) on Feb 07, 2005 at 07:03 UTC | |
|
Re: How to get the Pre-Match and Post-Match through Win32::OLE
by prasadbabu (Prior) on Feb 07, 2005 at 07:02 UTC | |
|
Re: How to get the Pre-Match and Post-Match through Win32::OLE
by holli (Abbot) on Feb 07, 2005 at 08:57 UTC |