How can I do a test to know when a shape is selected or no in VBA?

Started by Miguel, April 04, 2017, 06:44:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Miguel

Quote from: Surrogate on April 05, 2017, 01:31:33 PM
I wrong ! i mean that check connections and glue shape to shape are different task. I want know what you want ?

I would like to check the connections between the two shapes thanks to the connections points.


Quote from: Surrogate on April 04, 2017, 12:13:02 PMListing Connections in Visio 2010
Getting the Name of Glued Connection Points

I already read it thx.

wapperdude

@Miguel: 
QuoteAll of the points of controls are Inward&Outward!
These are connections, not controls.  It's confusing when incorrect terms are used.

Is this what you're saying?  Manually, you drag and drop a rectangle onto a drawing page.  Then you drag and drop a triangle.  The triangle is moved over to the rectangle and you want to know if it glued using code?   What is the purpose behind this?  There are several possibilities:
1)  as you move two shapes together, you should see connection point turn red, that means glued.  If not red, not glued.
2)  By code, you 1st have to select both shapes, then run code to check all connected shapes to see if these chosen ones both are connected together.  Then, color the shape.
3)  is that all you want)

Use the macro recorder:  you have to decide when to start the recorder...before shapes are dropped, after they are dropped, whatever.  Assume both shapes are already on page, start recorder, select triangle, slide it over and glue to rectangle, color triangle, stop recorder.  That gives process of gluing to shapes together. 

You might look at this:  https://msdn.microsoft.com/en-us/library/office/ff767122.aspx
and this:  https://msdn.microsoft.com/en-us/library/office/ff765584.aspx
and this:  https://blog.bvisual.net/2013/05/21/getting-the-name-of-glued-connection-points/

Wapperdude


Visio 2019 Pro

Surrogate


Quote from: Miguel on April 04, 2017, 06:44:37 AMHow can I do a test to know when a shape is selected or no in VBA?
I think it will be great test it via shapesheet ! If you aggry vote for this advice IsSelected and IsMouseOver ShapeSheet cell at Visio Suggestion Box