in reply to AddHyperlink in Visio

Have you read Using Win32::OLE and Excel - Tips and Tricks? It contains various approaches to using Win32::OLE, most of which translate to applications other than Excel.

Replies are listed 'Best First'.
Re^2: AddHyperlink in Visio
by Hossein (Acolyte) on Aug 27, 2013 at 11:45 UTC
    I did it now, but I can't see anything about Visio!

    $object->Hyperlinks->Add(...) does not work in Visio!

    It seems like Hyperlinks->Add or AddHyperlink doesn't exists in Visio contest!

    /Hossein

      In Visio (I have 2007) you go to the VB editor (Alt-F11), and then to the Object Browser (F2). Under classes you can see that the Shape objects have a Hyperlinks property. Again under classes you can see that the Hyperlinks objects have an Add method. I can't write some code to demonstrate this now, but this procedure should get you there with a little experimentation...

      UPDATE: Done some experiments myself. If $shape refers to some shape in the current document, then the following code creates a hyperlink, that turns up in the context menu of the shape.

      my $link = $shape->AddHyperlink(); $link->{Description} = "Google"; $link->{Address} = "http://www.google.de";

      This is a problem with Visio and not with Perl. You will then have to read the Visio documentation and find out what the appropriate method is.