Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: M$ Word ole hyperlink

by poj (Abbot)
on Jan 31, 2017 at 08:17 UTC ( [id://1180656]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1180656]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-18 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found