in reply to Setting Range using Win32:OLE
use strict; use warnings; use Win32::OLE; my $word = Win32::OLE->new('Word.Application') or die $!; $word->{'Visible'} = 1; my $document = $word->Documents->Add; my $selection = $word->Selection; $selection->TypeText("Please click here now"); my $range = $document->content; my $search = $range->Find; $search->{Text} = "here"; my $link = $search->Execute(); print $link ? "yes\n":"no\n"; #just so you can see $document->Hyperlinks->Add({ Anchor => $range, Address => "http://www.perlmonks.org" });
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Setting Range using Win32:OLE
by roshmont (Initiate) on Feb 07, 2006 at 02:55 UTC |