AccelTables and CommandBars

Started by michelleh, September 10, 2008, 01:34:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

michelleh

I am trying to replace the action for a command that is in the main drawing menu, the standard toolbar, and has an accelerator key.  I use the CommandBars objects to do all my menu and toolbar customization, but I can't find a way to deal with the accelator key without using the UIObject objects.  Is there a way I can get the the AccelItems through the CommandBar interface, or a way to make menu customization done with both CommandBar and UIObjects  play well together?  This seems like it would be common, but I can't find anything on doing this.

Thanks!!

Lars-Erik

Do you mean the keys for navigating true the menus?
Like Alt -> F -> O Would open a new file or am I not understanding this correctly?

If so, you can use the & symbol to tell what key to use for that. As an example,
the code could be like this:
.Caption = " Hell&o"

The caption will look like Hello , allowing you to pick that menu item using the o on the keyboard.

- Lars

P.S. If this isn't what you ment... hope someone else understood ur post...

michelleh

Thanks, Lars, but I don't mean the alt-key.

Say I want to run my own code when the user trys to save his drawing.  I can use the CommandBars objects to find the Save command in the menu and toolbar and change the OnAction and Parameter values for the CommandBar object to queue a marker event for my code to trap.  This also takes care of the alt-key So far so good.

But, as far as I know, I need to use the Visio application's BuiltInMenu's AccelTable objects to find the ctrl-S accelerator key and override it.

If I run the code to change the accelerator key, then the menu command isn't changed, and if I change the menu then the accelerator key isn't changed.  It looks like the CommandBar interface and the AccelTable interface are stepping on each other.

Lars-Erik

It's clear what you mean now, though, I'm afraid I don't know the solution to this one .