disable some shortcut key's

J

John Devlon

Hi

Does anyone know how to disable some shortcut key's like ...

CTRL + F3
CTRL + SHIFT + F3
CTRL + "2"

Thanx

JD
 
L

Larry

First, why do you want to do this? If you don't want to use those key
combos, simply don't use them. If you want to re-assign them to some
other macros, you can do that, using the Customize Keyboard dialog box
(Tools, Customize, Keyboard).

Of course, you can also remove key assignments through that dialog.

Larry
 
J

John Devlon

Hi,

I'm working on a template document in which some features has to disabled.
This document has to be distributed and i don't won't people to use
functions like bold, italic, underline ,...
I already disabled some buttons and menu items...

Now i'm looking for a way to disable some shortcut-keys


JD
 
M

Martin Seelhofer

Hey John
I'm working on a template document in which some features has to disabled.
This document has to be distributed and i don't won't people to use
functions like bold, italic, underline ,...
I already disabled some buttons and menu items...

Now i'm looking for a way to disable some shortcut-keys

A simpler and maybe more powerful (?) approach would
be to override the corresponding commands. Word allows
you to override any feature accessible through a menu item
or a command bar control. The only tricky thing is to find
out the exact internal command name (especially if you're
not English speaking). You might be able to find a list of
Word's command names with Google, though... Oh, just
remembered another possibility: if you've got the English
version of Word, you can look up the commands in the
Macro-dialog (Tools | Macro | Macros). In the 'Macro In'-
dropdown, choose 'Word commands'...

Example:

Write your own Bold()-function to override the internal Bold-
command. This lets your function run whenever someone
tries to apply bold formatting using the B-Button on the format
command bar or the shortcut CTRL + SHIFT + B.

Note, however, that people still will be able to apply bold
formatting through the format-dialog. But you can override
the call to that one as well writing your own FormatBold()-function.

Code:

Sub Bold()
MsgBox "Gotcha, Bold formatting not allowed :)"
End Sub

Sub FormatFont()
MsgBox "Ok, smart ass, get it: bold formatting is not allowed!"
End Sub



Cheers,
Martin
 
M

Martin Seelhofer

Hey again

Oops, a typo:
Note, however, that people still will be able to apply bold
formatting through the format-dialog. But you can override
the call to that one as well writing your own >>>FormatBold()<<<-function.

Should be "... your own FormatFont()-function."


Cheers,
Martin
 
J

John Devlon

Dear Martin,

Works great... Your the best

I'm only finding it hard to find an overview of all the commands ...

tried the msdn, the internet, ... but i'll keep looking

JD
 
M

Martin Seelhofer

Hi JD
Works great... Your the best

Wouldn't dare to say that ;-)
I'm only finding it hard to find an overview of all the commands ...

Yeah, it surely is not easy. To save you some hours of
intensive searching, here's a nice link:

http://word.mvps.org/Downloads/WordCommands.zip

and the corresponding article:

http://word.mvps.org/FAQs/General/CommandsList.htm
tried the msdn, the internet, ...

.... but obviously missed mvps.org ;-)
but i'll keep looking

I hope that is not necessary anymore :)


Cheers,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top