tags:

views:

29

answers:

2

I'm totally new on this so I want to start with something simple.

I have just an object in my Visio document and I want to display a Hello World! message whenever it's clicked.

A: 

What's the object?

The object is a normal shape, this is just the beginning in trying to click on a switch shape and establish a telnet session
Helgi
+1  A: 

I've done something similar to this using the SelectionAdded event on the Visio.Application class. I check, if the selection.count is 1, then logically that shape has just been clicked, and if the shape type matches what you want, then display your message:

In the ThisDocument module (any object module, really):

Private WithEvents VsoApp As Visio.Application
Private Sub VsoApp_SelectionAdded(ByVal Selection As IVSelection)
    If Selection.Count = 1 Then
        MsgBox "Hello World"
    End If
End Sub

Hope that helps.

-Jon

Jon Fournier
It works like a charm
Helgi