Home |
Search |
Today's Posts |
#5
|
|||
|
|||
It is possible to set a KeyBinding to Ctrl+x. All that the message really
means is that it can't (at the moment) bind it to the command you're trying to use. The most likely reason is that it can't find - or can't bind to - the command. If MenuItemNew1_Click is already bound to an ActiveX CommandButton you can't bind to it. However, if you KeyBind to it before creating the button the keybinding will stick - I don't know if that's an option for you. If it's in a UserForm I'm not sure you can do it at all. Don't know how any of this works with VSTO, I'm afraid - nor any of the C# references (why objKeyX instead of wdKeyX for example? - and what is the diference between This.Application and ThisApplication?) -- Enjoy, Tony wrote in message ps.com... Hi, We are in the process of building VSTO 2005 customizations for MS Word 2003. One of our requirement is to overwrite short cut keys function in word. Say for example, when a user presses ctrl+X keys the selected text should not be cut, that is the default function of ctrl+X should not be fired. Instead my function (Managed code and not a Macro) should be executed. We tried with Application.KeyBindings.Add but got the following error: Word cannot change the function of the specified key. Code: this.Application.KeyBindings.Add(WdKeyCategory.wdK eyCategoryCommand, "MenuItemNew1_Click", ThisApplication.BuildKeyCode(WdKey.wdKeyControl, ref objKeyX, ref missing, ref missing), ref missing, ref missing); Where MenuItemNew1_Click is a userdefined function. Any pointers in resolving the same will be appreciated. Thanks. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Word2000 letterhead merge | Mailmerge | |||
Making Word do something that Wordperfect can do | New Users | |||
How do I get my default new document to always be our company let. | Microsoft Word Help | |||
WordPerfect keyboard macro>Word equivalent? | New Users | |||
creating forms | Microsoft Word Help |