Discussion:
Can't create selection of all the sub items of a given layer
(too old to reply)
aviad_e
2004-07-08 19:10:47 UTC
Permalink
Hi
Im trying to create a selection of all the shapes of a given layer, if
the shapes are top level items its works fine, but if the shapes are
sub items the function returns an empty collection, the same thing
happened when trying to create a selection of all the shapes of a
given master or given type, its like the IterationMode doesn't work at
all,

Here is my code,

Dim visSelection As Visio.Selection
Dim visLayer As Layer

Set visLayer = ActivePage.Layers(LayerName)
Set visSelection = _
ActivePage.CreateSelection(visSelTypeByLayer, visSelModeOnlySub,
visLayer)

Debug.Print visSelection.Count ' print 0

I have tried to replace the active page with the sub items parent but
that doesn't work either.

Thanks,
p***@gmail.com
2014-06-05 13:05:24 UTC
Permalink
Post by aviad_e
Hi
Im trying to create a selection of all the shapes of a given layer, if
the shapes are top level items its works fine, but if the shapes are
sub items the function returns an empty collection, the same thing
happened when trying to create a selection of all the shapes of a
given master or given type, its like the IterationMode doesn't work at
all,
Here is my code,
Dim visSelection As Visio.Selection
Dim visLayer As Layer
Set visLayer = ActivePage.Layers(LayerName)
Set visSelection = _
ActivePage.CreateSelection(visSelTypeByLayer, visSelModeOnlySub,
visLayer)
Debug.Print visSelection.Count ' print 0
I have tried to replace the active page with the sub items parent but
that doesn't work either.
Thanks,
I am having the same problem. I have tried every possible value of IterationMode, and I cannot get a selection to include any grouped objects no matter how the objects are selected. This must be a bug.

I am using Microsoft Office Visio 2007 (12.0.4518.1014) MSO (12.0.6683.5000).
Microsoft Windows 7 Enterprise, Service Pack 1.

Loading...