Is this a Group?

M

Mac

How do I detect whether my ActiveWindow.Selection is a Group? What comes to
my mind is checking whether the Item collection's Count property is > 1. Is
this legal and a sufficient test?
 
J

JuneTheSecond

I think you may be right.
my test macro is ....

Sub test()
Dim shp As Visio.Shape
ActiveWindow.SelectAll
For Each shp In ActiveWindow.Selection
If shp.Shapes.Count = 0 Then
Debug.Print shp.Name & " is simple shape."
Else
Debug.Print shp.Name & " is group."
End If
Next
End Sub

my test macro is
 
M

Mac

I am looking at the hierarchy and this is what I can see: Selection.Item's
Type_ property = 2, type 2 = Group type!:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top