Shapesheet of a Selection of Shapes via Code?

Started by david, September 15, 2008, 08:20:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

david

i've noticed that if i select several shapes then it shows all the identical custom properties of all the shapes i selected (and omits the rest).  i want to reach the relevant cells in the shapesheet by code.  but i checked about the Cells property and it belongs only to Shape and Style.  i didn't find a way to reach the shapesheet through Selection or Shapes.

anyone knows how to get them?

thanks in advance
David

Visio Guy

#1
Hi David,

There is no ShapeSheet for a selection. A selection is a group of shapes. When you see a union of data fields, Visio is doing that analysis on the fly.

To get at the ShapeSheet of selection members, you do something like this:


Dim sel as Visio.Selection
Set sel = Visio.ActiveWindow.Selection

Dim shp as Visio.Shape
For Each shp in sel
  Debug.Print shp.Cells("Prop.Cost").ResultIU
  Debug.Print shp.Cells("Prop.Cost").Formula
Next shp
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

david

thanks.

somehow i was sure that if i see common properties of several shapes then they're written in some shapesheet and i can reach them.
but never mind, i'll find the common properties in my code.