G
gnicholls
Hi,
I know this is a real novice question, but could anybody tell me how t
run a piece of code based on a Visio event. I'm playing around with th
following code :-
Private Sub Command1_ShapeAdded()
Dim shp As Visio.Shape
Dim S As String
Set shp = Visio.ActiveWindow.Selection.Item(1)
S = "Shape Name = " & shp.Name
S = S & Chr(13)
S = S & "Shape Area = " & shp.AreaIU & " Square Inches."
MsgBox S
End Sub
As long as I add a shape to a visio document I can run this code fro
within the VB editor and get the results that I want. However eithe
I'm missing the point or missing a step, but I want this code to ru
from within the Visio document simply when a shape is added (I don'
want to have to run it from the VB editor or have to select a Macro t
run).
Just to push my luck, if anyone knows the answer to the above woul
they be able to indicate with the above example how to make the cod
run based on the Click event so that if I have one shape on the activ
document and then click on it the message box is then presented.
Any help would be appreciated
I know this is a real novice question, but could anybody tell me how t
run a piece of code based on a Visio event. I'm playing around with th
following code :-
Private Sub Command1_ShapeAdded()
Dim shp As Visio.Shape
Dim S As String
Set shp = Visio.ActiveWindow.Selection.Item(1)
S = "Shape Name = " & shp.Name
S = S & Chr(13)
S = S & "Shape Area = " & shp.AreaIU & " Square Inches."
MsgBox S
End Sub
As long as I add a shape to a visio document I can run this code fro
within the VB editor and get the results that I want. However eithe
I'm missing the point or missing a step, but I want this code to ru
from within the Visio document simply when a shape is added (I don'
want to have to run it from the VB editor or have to select a Macro t
run).
Just to push my luck, if anyone knows the answer to the above woul
they be able to indicate with the above example how to make the cod
run based on the Click event so that if I have one shape on the activ
document and then click on it the message box is then presented.
Any help would be appreciated