Visio Guy

Visio Discussions => Programming & Code => Topic started by: Visisthebest on January 10, 2021, 07:11:24 AM

Title: Putting CALLTHIS subs in the shape context menu on a keyboard shortcut
Post by: Visisthebest on January 10, 2021, 07:11:24 AM
I am very fond of using CALLTHIS to add functionalities in the right-click menu of a shape (with the underlying code in the stencil).

Is it possible to add keyboard shortcuts to these, so that if a user selects a shape those keyboard shortcuts will activate the specific CALLTHIS call?

Thank you for your help and advice!
Title: Re: Putting CALLTHIS subs in the shape context menu on a keyboard shortcut
Post by: Surrogate on January 10, 2021, 08:15:58 AM
Sub-routine which call via CALLTHIS must have parameters
(https://visio.getbb.ru/gallery/image.php?pic_id=46)

from Visio 2002 Developer's Survival Pack (by Graham Wideman) (http://books.google.ru/books?id=8q5RG2CwF5wC&lpg=PP1&hl=ru&pg=PA232#v=onepage&q&f=false)
Title: Re: Putting CALLTHIS subs in the shape context menu on a keyboard shortcut
Post by: Visisthebest on January 10, 2021, 08:57:39 AM
Thank you surrogate I've been using CallThis for a long time (I didn't realize that CALLTHIS doesn't have the VBA reference issues, it just works so forgot about it).

The question is, can I tie the menu item on the shape using CALLTHIS to a keyboard shortcut key (so the user can activate it with a keyboard shortcut)?

Title: Re: Putting CALLTHIS subs in the shape context menu on a keyboard shortcut
Post by: Surrogate on January 11, 2021, 05:25:19 AM
The question is, can I tie the menu item on the shape using CALLTHIS to a keyboard shortcut key (so the user can activate it with a keyboard shortcut)?
Oh, I'm sorry! I'm russian and I didn't understand your question :(
Not sure that we can use keyboard shortcuts from external stencil. Sometime i create master-shapes with context menu, this menu can call sub-routines from vss-file and have shortcut in context menu.
(https://i.ibb.co/Jdb693H/2021-01-11-13-15-12.png)
I call macro when press menu key (https://en.wikipedia.org/wiki/Menu_key) on keyboard (≣ Menu) and "q"
(https://kompsekret.ru/images/content/941108/591d9a98a0032a4577840f9b3d1162f9.png)
Title: Re: Putting CALLTHIS subs in the shape context menu on a keyboard shortcut
Post by: Visisthebest on January 11, 2021, 05:57:24 AM
Thank you surrogate this is also a useful solution to use the context menu faster via the keyboard! I don't have the menu key on this particular keyboard but I can no doubt assign it to a key and use it.
Title: Re: Putting CALLTHIS subs in the shape context menu on a keyboard shortcut
Post by: Surrogate on January 11, 2021, 06:54:14 AM
You can use Shift+F10 instead Menu Key

7 years we have there same thread (http://visguy.com/vgforum/index.php?topic=5766.0)....
Title: Re: Putting CALLTHIS subs in the shape context menu on a keyboard shortcut
Post by: Visisthebest on January 11, 2021, 07:28:20 AM
Thank you for the tip Surrogate!
Title: Re: Putting CALLTHIS subs in the shape context menu on a keyboard shortcut
Post by: Visisthebest on January 11, 2021, 08:46:51 AM
Solution I am using in addition to Surrogate's tip:
http://visguy.com/vgforum/index.php?topic=9413.0