Answered VBA For Visio: Highlighting connectors

  • Wednesday, July 11, 2012 3:43 PM
     
     

    Hi there,

    I'm trying to find a way to click on a shape and automatically highlight all the CONNECTORS glued into it. I've explored a couple options using macros, particularly using the expression.connect command. I'm able to select shapes that are connected to the selected shape, but not specifically the connectors. I want to highlight these only when the shape  they are connected to is selected. The map is pretty confusing and a visual aid like this could be very beneficial. Could you please let me know which command is the right one to select CONNECTORS and retrieve them as shapes in VBA?

    Thanks

All Replies

  • Wednesday, July 11, 2012 8:34 PM
     
     Answered

    I'd suggest getting a copy of the Visio SDK (v2010 edition). It has sample code for analyzing connections. Without knowing specifcally what you're working with it can get pretty muddy, pretty fast. These might help

    http://www.visguy.com/2009/04/22/analyze-connectivity-between-process-flows/

    http://www.visguy.com/2009/04/08/path-analysis-in-visio/

    al


    If this answer solves your problem, please check Mark as Answered. If this answer helps, please click the Vote as Helpful button. Al Edlund Visio MVP

  • Tuesday, July 17, 2012 5:49 AM
     
     

    Hi Al,

    Thanks for replying! I finally came up with a little macro that does the work and the boss is happy now, he can read through a spiderweb of connectors with a simple key stroke! I don't know if it's the most elegant code I've ever seen, but as an unexperienced programmer I'm very happy with the results. Thanks for sharing those useful links!

    Take care,


    Jorge Macedo

  • Thursday, August 09, 2012 6:57 PM
     
     
    Would you be willing to share the code?  I have the exact same issue (a desire to highlight every shape and connector connected to the shape I have selected).