Capturing Data from Selected Shape

R

Rob

Hi,
I have a need to capture certain properties of a selected shape. What I want
is to be able to have a macro that I am writing capture the custom properties
"Section" and "Row" when a user double clicks on a shape in my Visio drawing.
There is approximately 150 shapes but all have the same custom properties.

Im thinking that it might be something like... "me.Prop.Section" but I know
that I'm wrong.

Any Ideas???

Thanks oin Advance,
Rob
 
C

Chris Roth [MVP]

Hi Rob,

There are two ways to get at ShapeSheet cells (where custom properties are
stored):

shp.Cells("cellname")
shp.CellsSrc(section, row, column)

To get a custom property string, for example:

shp.Cells("Prop.Cost").ResultStr(visNoCast)

Or the width of a shape:

shp.Cells("Width").ResultIU
shp.CellsSrc(visSectionObject, visRowXform, visWidth)

(I'm guessing on the s, r, c of Width -- hit F1 in a ShapeSheet cell)

Maybe this will get you started!

--
Hope this helps,

Chris Roth
Visio MVP

Free Visio shapes:
http://www.visguy.com/category/shapes
Visio programming info:
http://www.visguy.com/category/programming/
Other Visio resources:
http://www.visguy.com/visio-links/
 
R

Rob

OKay, I don't totally understand it but would I be able to do it like this...

MsgBox "You have selected " & shp.CellsSRC(3, 2, 5) & " As your Item"

Because I get a runtime 424 error.

Thanks.
 
R

Rob

I've also tried this...

MsgBox "You have selected " & shp.Cells("Prop.Name").ResultStr(visNoCast) &
" As your Item"
 

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