3dbc has asked for the wisdom of the Perl Monks concerning the following question:
#!/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});
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: M$ Word ole hyperlink
by poj (Abbot) on Jan 31, 2017 at 08:17 UTC | |
by 3dbc (Monk) on Jan 31, 2017 at 19:50 UTC | |
|
Re: M$ Word ole hyperlink
by pryrt (Abbot) on Jan 31, 2017 at 14:48 UTC | |
by 3dbc (Monk) on Jan 31, 2017 at 18:00 UTC | |
by poj (Abbot) on Jan 31, 2017 at 18:15 UTC | |
by pryrt (Abbot) on Jan 31, 2017 at 19:20 UTC | |
by 3dbc (Monk) on Jan 31, 2017 at 22:34 UTC | |
by pryrt (Abbot) on Jan 31, 2017 at 23:22 UTC | |
|