Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can I disable/re-programme F1 key 1

Status
Not open for further replies.

stoke

IS-IT--Management
Apr 15, 2003
50
0
0
AU
this is on;y a small matter, but one that i find irritating, as i keep hitting F1 when i want to hit F2.
if i could disable this function i would be chuffed.
 
Option1: Delete the help files
Option2: Get a meat slicer and trim them fingers down ;-)

Seriously tho, I very much doubt you can do anything about it - F1 is the standard help key for all M$ apps

Rgds, Geoff
Si hoc legere scis, nimis eruditionis habes
Want the best answers to your questions ? - then read me baby one more time - faq222-2244
 
Thanks chief - thought it was worth a shot.
actually your idea about meat slicer gave me an idea - i looked at my scissors then thought if the mountain won't come to.......etc. so i've just taken the F1 out of the keyboard.
Thanks and thanks for all the help you you give.
Nathan.
 
Hi stoke,

In Excel, you can disable F1 (or any other key) via VBA with:

Code:
Application.OnKey "{F1}",""

.. and reset it back with:

Code:
Application.OnKey "{F1}"

Enjoy,
Tony
 
stoke - [LOL]
Tony - luvverley jubberley - you always come up with something when I say it can't be done :)

Rgds, Geoff
Si hoc legere scis, nimis eruditionis habes
Want the best answers to your questions ? - then read me baby one more time - faq222-2244
 
Tony,
You just keep on coming with the useful answers. I have gotten several tips like this from you just by reading the answers you give other people. Thanks again; this forum is truly a better place with you around.

Some related questions:
1) how is this done in other apps? (I tried this in Word and it didn't work)
2) inside the second set of quotes, is it possible to put in the name of a sub and have that execute?
 
Krinid - I doubt you can call a macro BUT - you might be able to enter the double keystroke set up as the shortcut for the macro......

Rgds, Geoff
Si hoc legere scis, nimis eruditionis habes
Want the best answers to your questions ? - then read me baby one more time - faq222-2244
 
Cheers Geoff,

I do like your method, though ...

User.Fingers(1).Select
Application.MeatSlicer.Execute
MsgBox "Don't want help, huh?" , vbCritical

[thumbsup2]

Enjoy,
Tony
 
Geoff,
What you mean by "enter the double keystroke set up as the shortcut for the macro".

I've played around and found that by entering:
Application.OnKey "{F1}", "TestProc"

and creating the sub "TestProc" in a module in the workbook active when I entered the statement, I could successfully cause a macro to be executed when F1 is pressed.

To be able to use a workbook other than the active workbook, the following statement could be used, where WB is a Workbook:

application.OnKey "{F1}", WB.FullName & "!testproc"
 
Hi krinid,

Thanks for the compliment. [smile]

1. Being as how it's an integrated suite, here's how to do it in Word:

Code:
Customizationcontext= Documents(1)
Code:
 ' or NormalTemplate or wherever you want to put it
Code:
Keybindings.add keycode:=buildKeyCode(wdKeyF1), Keycategory:=wdkeycategoryDisable, Command:=""

and you clear it with:

Code:
Customizationcontext= Documents(1)
Keybindings.key(buildKeyCode(wdKeyF1)).Clear

2. Yes

Enjoy,
Tony
 
Tony - hee hee - another one for personal.xls ;-)
Krinid - nice one - I was referring to the CTRL+key that you can set up for the shortcut to run a macro but it looks like it works with the macro name - cool

Rgds, Geoff
Si hoc legere scis, nimis eruditionis habes
Want the best answers to your questions ? - then read me baby one more time - faq222-2244
 
Hi Guys,

One thing to note is the scope (and order of precedence) of key assignments.

In Excel, keys set via
Code:
Application.OnKey
only exist for the current instance of Excel. Keys set via
Code:
Application.MacroOptions
(or <Alt><F8>) are saved with the workbook. Application settings take precedence over Workbook settings.

In Word, the
Code:
CustomizationContext
makes it more obvious. Highest priority is document, then attached template, then normal template.

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top