Re: Connector Macro Help
am 15.11.2007 18:18:09 von Paul HerberOn Thu, 15 Nov 2007 08:54:29 -0800 (PST), joey_costanza@msn.com wrote:
>Hello Everyone,
>I am very stuck and I was wondering if any of you could give me a
>hand. I'm trying to write a Perl or VB script to connect some
>rectangles in Visio with a 'connector'. I have found there is very
>little help online in the way of making Visio macros with Perl. I have
>found Perl can translate directly in to Visual Basic in most cases by
>substituting "->" in for ".". For some reason, however, I am not able
>to say
>
>$Visio->ActivePage->Drop($Visio->ConnectorToolDataObject, 2, 2);
>where $Visio is the Visio Application. I am using the Win32::OLE
>library by the way.
>
>Fortunatly, I am able to connect the shapes with the connector by
>having it select the two rectangles and using
>
>$Visio->ActiveWindow->Select($square1, 2);
>$Visio->ActiveWindow->Select($square2, 2);
>$Visio->ActiveWindow->Selection->ConnectShapes;
The ConnectShapes method will return an object, the shape object of
your new connector. This will be your $connector.
(I haven't tried or checked this.)
>Anyway...my main goal is to change the color of the connector. Is
>there anyway to do this by way of the method I am using. I think I
>need to set the connector it created equal to a variable somehow, that
>way I can use the $connector->cells("LineColor")->{Formula} = color.
use an RGB(r,g,b) string for your colour.
--
Regards, Paul Herber, Sandrila Ltd.
Electronics for Visio http://www.electronics.sandrila.co.uk/