Can't create selection of all the sub items of a given layer

A

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,
 

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