Validate if ActiveWindow.Selected Shape is In A Container

Started by soulshined, September 12, 2017, 11:30:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

soulshined

I'm simply trying to determine if the currently selected object (shape) is INSIDE a container.

After I verify shape is inside container I would like to set a variable to the container object to use later


   Dim activeShp As Shape, containerShp As Shape

   Set activeShp = Application.ActiveWindow.Selection(1)
   Debug.Print activeShp.ContainingShape.ContainerProperties.ContainerType 
   


That isn't working. ContainerType is supposed to return Nothing if it is not a container, 0 & 1 otherwise. I've been trying everything on the Shape MSDN with no luck. There has to be a fool proof way to test if a selected item is in a container right?

wapperdude

Visio 2019 Pro


wapperdude

Cool!  I have V2007 so couldn't directly answer your question.  Glad it was resolved.
Visio 2019 Pro