getting custom property of double clicked shape

R

Robert Sikkens

Hi everyone,

when I double click on a shape in my drawing a userform pops up. I want to
fill the textbox on the userform with the value of a custom property of the
double clicked shape. Does anyone know how I can do this with vba?

Thanks
 
C

Chris Roth [ Visio MVP ]

Here's some example systems:

--------------------------------------------------
Get the property from the shape via code:


Shape
-----
EventDblClick = CALLTHIS("ShowMyForm")


VBA
-----
Public Sub ShowMyForm( shp as Visio.Shape )

Dim sProp as string
sProp = shp.Cells("Prop.SomeProperty").ResultStr(visNoCast)

' Show form, pass sProp to form...

Next

--------------------------------------------------
Pass the argument from the shape:


Shape
-----
EventDblClick = CALLTHIS("ShowMyForm", ,Prop.SomeProperty)


VBA
-----
Public Sub ShowMyForm( shp as Visio.Shape, sProp as String )

' Show form, pass sProp to form...

Next

--------------------------------------------------

Check out CALLTHIS in the help file, as well as Shape.Cells( )

--

Hope this helps,

Chris Roth
Visio MVP
 

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