Can I get the name of the layer a connector is assigned to in vba?
I am doing this with shapes like this
ActivePage.Shapes(1).layer(1)
And now I am looking for something similar but for connectors.
Can I get the name of the layer a connector is assigned to in vba?
I am doing this with shapes like this
ActivePage.Shapes(1).layer(1)
And now I am looking for something similar but for connectors.
Copyright © 2021 Jogjafile Inc.
I'm not completely clear on your issue, but there's nothing special about connectors - they're still just shapes. So if you know the index of your target shape and layer, then you can use your code above.
Shapes in Visio can also belong to multiple layers (layers don't work in the same way as, say, Photoshop), so you might want to get the layer count first and then run through each one. For example:
Also, depending on what you're trying to do, you might want to take advantage of the Page.CreateSelection method to return a selection based on shapes on a particular layer. Here's a very slightly modified version from the Visio SDK:
If you're using the Dynamic Connector, this gets automatically assigned to a layer called 'Connector'.