Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

associate events with a custom shape

Status
Not open for further replies.

drluggo

Programmer
Jan 14, 2003
39
US
I am creating my own stencil with several custom shapes that I want to assign events, properties, methods to. I would like the user of the shapes within my stencil to be able to place these shapes on their drawings and exhibit the same behaviour and I am having trouble.

What happens is that within the stencil file (.vss) I have a shape called Valve. In the shapesheet I associate the DblClick Event with a subroutine using RUNADDON("ThisDocument.Message")

Public Sub Message

MsgBox "Hello World!"

End Sub

All of the above is in the stencil file. When I double click on the shape in the stencil file I get the message box.

When I open up a regular Visio drawing and drop this shape on it, the double click behavior does not occur. I am assuming it is because of the ThisDocument object I am associating the event with and the Message routine does not exist in the Visio drawing (just in the stencil).

I want to have the user be able to drop many vales on a drawing and have each of them exhibit the double click behavior. Obviously the final goal is not to just have them give messages, so they have to be able to execute code that has knowledge of the its own name and other custom properties.

Any suggestions???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top