0

Is it possible to assign a keyboard shortcut to a basic keypress in MS Word?
When I right click on the ribbon, select Customize the Ribbon, then under the left list find "Keyboard Shortcuts" and click Customize, there is a box to "Press new shortcut key" but a basic keypress just doesn't register anything in that box, unless I've previously pressed a function key or a combination with Alt/Ctrl.


The intended application is to assign this macro to the period (.):

Sub PeriodSave()
    Selection.TypeText Text:="."
    ActiveDocument.Save
End Sub

The motivation for trying to configure this shortcut is because OneDrive integration makes Word unstable. Frequent crashes sometimes cause lost work as well as require extra work comparing "Last Saved By User" with "Recovered" and "Autorecovered" versions.

If this solution is possible, it'd be easier than trying to remember to do Ctrl+s very frequently, because I apparently can't remember that often enough (and would rather focus attention on the concepts I'm working with).

AutoRecover does not always work right, so just increasing the frequency via File->Options->Save->Save documents->Autorecover interval isn't a full solution.

0

Construct and run a macro like this:

Sub PeriodSaveConfig()
    KeyBindings.Add KeyCategory:=wdKeyCategoryCommand, Command:="PeriodSave", KeyCode:=BuildKeyCode(wdKeyPeriod)
End Sub

The options for where wdKeyPeriod is in the example above can be found here or here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.