Invalid Window type for this action

Started by madhushalini.p, August 19, 2011, 06:52:14 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

madhushalini.p

Hi

vApp.ActiveWindow.DeselectAll()

        For ik = 0 To shapeobject.Count - 1
            vApp.ActiveWindow.Select(vApp.ActiveWindow.Page.Shapes.ItemFromID(shapeobject(ik).id), Visio.VisSelectArgs.visSelect)

        Next

    vApp.ActiveWindow.Selection.Group()
I am also getting the same error:Invalid window type for this action.

Any help is appreciated...
Thanx in advance


Visio Guy

Hi MH,

What is shapeobject? If it's a Visio.Shape, then .Count won't work properly. Is it a Collection of shapes?

If shapeobject is a grouped shape, then you need shapeobject.Shapes.Count. And then you are trying to subselect shapes within a group, which is probably going to need some tweaking with IterationMode to work properly.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010