Which tool is active ?

Started by Arnaud, July 10, 2013, 01:12:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Arnaud

Dear all,

does anyone know how to know which tool is active ? pointer, connector, connection point...

I especially would like to detect the connector one.

I added an event on the right-click + Ctrl to select the connector one. And I would like to make this shortcut like a toggle button:
- if the connector tool is not active, it activates it.
- if it is active, it activates the pointer tool.

Thanks in advance for your help !
Arnaud

JuneTheSecond

Next code tells active tool.


Option Explicit

Dim WithEvents app As Visio.Application


Private Sub app_EnterScope(ByVal app As IVApplication, ByVal nScopeID As Long, ByVal bstrDescription As String)
    MsgBox bstrDescription
End Sub

Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
    Set app = ActiveDocument.Application
End Sub


Put this code in ThisDocument module.
If this code does not work, please try to install Visio SDK.

By the way, I found this way by running Visio event monitor
that is included in the Visio SDK.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

charlykuntz

Hello,

I faced a smililar issue a few weeks ago. With Junes solution you can detect if a tool has been changed but you have no chance to aks Visio which tool is currently active. The only solution I found out was to put the activated tool for each window in a variable.

Arnaud

Hi,

sorry for the delay. I used the described solution and it perfectly fits my need. :D Thank you both !

Arnaud.