Running registered commands from contextmenu

Running registered commands from contextmenu

Anonymous
Not applicable
413 Views
2 Replies
Message 1 of 3

Running registered commands from contextmenu

Anonymous
Not applicable

Hi,

 

I need some help regarding how to run registered commands from contextmenu. I've successfully created the contextmenu and I am calling directly the subroutines, but what will be the best approach, using sendstringtoexecute? After all I've read, sendstringtoexecute is not recommended all the time. The reason why I want this is to simplify rerunning a command through right-click menu.

 

Thank you,

 

George

0 Likes
414 Views
2 Replies
Replies (2)
Message 2 of 3

chiefbraincloud
Collaborator
Collaborator

The context menu click handler should be a separate sub that uses SendStringToExecute to call your command method.

 

I don't remember what error I got, but when I tried to make the handler call the Sub directly, it gave me a runtime error.

Dave O.                                                                  Sig-Logos32.png
0 Likes
Message 3 of 3

Anonymous
Not applicable

Right now I have the code directly in the handler and it is working ok, but to repeat the command I have to right-click again and choose the command (actually from  the submenu). I f I separate the code into a different sub and use SendStringToExecute, the code won't work first time because it is asynchronous (I think), though I will get the command in "Repeat Command" and "Recent Command" and this is what I want too, but I feel that I am missing something and I don't know what.

 

Thanks,

 

George

0 Likes