Disable Function Keys in VBA

K

Kassam

How do I disable a function key in VBA. For example, F7,
which always ends up with spell check even after executing
the code on 'key down' event.
Thanks
 
D

Douglas J. Steele

Try creating an AutoKeys macro that remaps the F7 key to some other action.
 
R

R. Hicks

Set the Form's Key Preview property to True and put the following code
behind the OnKeyDown event.

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF7 Then
KeyCode = 0
End If
End Sub

Ricky Hicks
 
Top