in reply to Re: Word find and replace with bold
in thread Word find and replace with bold
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 |