shape selected in a group is not in selection

K

Kati Molnar

I have a shape A as part of group B. They move together, so the grouping is
right. I have an action VBA macro assigned to shape A, but not to group B. I
select shape A, right click on it, and start the macro. However, inside the
macro, Application.ActiveWindow.selection.count returns 0.

How can there be no selection when the action is available only for shape A?
If shape A was not selected, the action would not be there in the popup menu?

Thanks for any insight,

Kati
 
M

Mark Nelson [MS]

Check out the help topic for the IterationMode property. When dealing with
sub-shapes and selections, you have to tell Visio to report on the
sub-shapes in a group. Get the Selection object, set IterationMode to what
you want and then check the count of the object.
 
M

Michael Pollard

I am attempting to change the IterationMode, but it doesn't seem to "take".

Before: Application.ActiveWindow.Selection.IterationMode = &H0500

Code: Application.ActiveWindow.Selection.IterationMode = visSelModeSkipSuper
(&H0100)

After: Application.ActiveWindow.Selection.IterationMode = &H0500

Because of this, the Count is the same before and after.

Any thoughts?

Thank you,
Michael Pollard
--------------------

:
Check out the help topic for the IterationMode property. When dealing with
sub-shapes and selections, you have to tell Visio to report on the
sub-shapes in a group. Get the Selection object, set IterationMode to what
you want and then check the count of the object.

I have a shape A as part of group B. They move together, so the grouping is
right. I have an action VBA macro assigned to shape A, but not to group B.
I select shape A, right click on it, and start the macro. However, inside
the macro, Application.ActiveWindow.selection.count returns 0.

How can there be no selection when the action is available only for shape A?
If shape A was not selected, the action would not be there in the popup menu?
Thanks for any insight,
Kati
 

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