#!/usr/bin/perl 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("Click here"); my $range = $word->ActiveDocument->Content; $document->Hyperlinks->Add({ Anchor => $range, Address => "http://www.perlmonks.org" }); #### $sel->Find->{Text} = '##HYPERLINK##'; $sel->Find->Execute; $sel->Delete; #$sel->InsertAfter->Hyperlinks->Add({("$link")}); my $hyperlink = "http://www.perlmonks.org/"; $sel->TypeText("Sharepoint Link"); my $range = $MSWord->ActiveDocument->Content; $doc->Hyperlinks->Add({ Anchor => $range, Address => "$hyperlink" }); $sel->MoveDown({Count=>1});