View Single Post
  #2   Report Post  
CyberTaz
 
Posts: n/a
Default

Hi Jay-

I don't claim to be aprogrammer, but on the basis of the example you gave
(Ctrl+X), you may be looking to the wrong culprit. Many kybd shortcuts are
_Windows_ based and merely supported within the applications. If you need to
override them it may have to be done at the OS level.

Regards |:)

" wrote:

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.