in reply to M$ Word ole hyperlink

Try

#!/usr/bin/perl use strict; use warnings; use Win32::OLE; my $MSWord = Win32::OLE->new('Word.Application') or die $!; $MSWord->{'Visible'} = 1; my $doc = $MSWord->Documents->Open("c:/temp/Word.doc"); my $sel = $MSWord->Selection; for my $n (1..2){ $sel->Find->{Text} = "##HYPERLINK$n##"; next unless $sel->Find->Execute; $sel->Delete; $sel->Hyperlinks->Add({ TextToDisplay => "Sharepoint Link $n", Anchor => $sel->Range, Address => "http://www.perlmonks.org/" }); $sel->MoveDown({Count=>1}) }
poj

Replies are listed 'Best First'.
Re^2: M$ Word ole hyperlink
by 3dbc (Monk) on Jan 31, 2017 at 19:50 UTC
    This worked very well, thanks so much.
    - 3dbc