Post by nickblades » Fri, 06 Aug 2004 00:25:19

Is it possible to set up a system that when a shape is clicked once,
the custom properties are displayed. I'm using visio2000 and have
been trying to do this with an Anchor but i don't seem to be able to
get it to work. is it possible



Post by Al Edlun » Fri, 06 Aug 2004 00:51:30

you can do it in vba by monitoring the winObj_SelectionChanged event.



Post by nickblades » Thu, 12 Aug 2004 17:42:07

Thanks again Al,
just one little question, i've now managed to get this to work but it
is very tempremental. Would there be any reason why it would not work
when the document is opened as a copy?
At the moment i'm using the following code in thisdocument section
Option Explicit
Public WithEvents winObj As Visio.Window

Private Sub Document_BeforeDocumentClose(ByVal doc As IVDocument)
'clears the memory before the document is closed
Set winObj = Nothing
End Sub

Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
'sets the active window and runs module4(user form)
Set winObj = Visio.ActiveWindow
End Sub

Private Sub winObj_SelectionChanged(ByVal Window As IVWindow)
'when selection is changed an option button is activated so as data is
inputted into the userform
UserForm1.OptionButton1.Value = False
UserForm1.OptionButton1.Value = True

End Sub


Post by Al Edlun » Fri, 13 Aug 2004 00:56:29

standard coding says that you should always initialize a variable before
using it, you don't know what might have been left over from last time.
Consider intializing your variables when either ther user forms are opened
or the document opens...