Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Word find and replace with bold

by Selvakumar (Scribe)
on Jul 23, 2009 at 12:18 UTC ( [id://782659]=note: print w/replies, xml ) Need Help??


in reply to Re: Word find and replace with bold
in thread Word find and replace with bold

This is my below code and i need to apply the word boundary in find statement or any other method to search the text with regular expressions.
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\ch01.doc'); $word->Selection->HomeKey(wdStory); $word->Selection->Find->{'Text'}=$text; $word->Selection->Find->Replacement->{'Text'}=$text; $word->Selection->Find->Replacement->Font->{'Bold'}=1; $word->Selection->Find->Execute({Replace=>wdReplaceAll}); } $word-> ActiveDocument->SaveAs('c:\ch01_updated.doc'); $document-> Close(); $word-> Quit();

Replies are listed 'Best First'.
Re^3: Word find and replace with bold
by mzedeler (Pilgrim) on Jul 23, 2009 at 16:17 UTC

    Your program contains syntax errors and can't run in the state you posted it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://782659]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-19 22:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found