I cannot get the information of the method SpartialNeighbors out of a "Package (expanded)" shape.
Normally I use this code:
Dim s As Shape, vsoShapeOnPage As Shape
Dim vsoReturnedSelection As Visio.Selection
's contains the current shape
Set vsoReturnedSelection = s.SpatialNeighbors(visSpatialContain, 0, visSpatialIncludeContainerShapes)
If vsoReturnedSelection.Count = 0 Then
'No Shapes contained
Else
For Each vsoShapeOnPage In vsoReturnedSelection
'Code
Next
End If
And this works perfectly fine for shapes like in the default UML stencil (nameU = "Overview")
I know I could group the shapes, but it increases the effort.
Another point, when I analyse other shapes I see with "MemberOfContainers" that the shape is contained in "Package (expanded)". So it must be possible to get the information from the other way around without going through all shapes.