Pages

Sunday, February 22, 2009

How to disable user from using short-cut keys using VBA

How to disable shortcut keys in VBA

You can disable the keybinding using the following code

Sub VBA_Sys()

' Disable Ctrl + S

FindKey(BuildKeyCode(wdKeyControl, wdKeyS)).Disable

' Rebind Ctrl + S to FileSave

FindKey(BuildKeyCode(wdKeyControl, wdKeyS)).Rebind wdKeyCategoryCommand, "FileSave"

End Sub

The above code disables Ctrl +S FileSave command. Use the rebind method to restore the bind.

1 comment:

  1. Thanks a ton it has been a great help, now to disable user from using short-cut keys using vba is without a doubt simple and easy with the help of your information. Kudos

    ReplyDelete