Created
August 25, 2012 13:28
-
-
Save dck-jp/3465660 to your computer and use it in GitHub Desktop.
SetShortcutKeys @ VBA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub SetShortcutKeys() | |
Dim macroSetting As Variant | |
Dim commandSetting As Variant | |
macroSetting = Array( _ | |
"EraseColor", wdKeyControl + wdKeyQ, _ | |
"EraseHighlight", wdKeyControl + wdKeyT, _ | |
"ToggleUnderline", wdKeyControl + wdKeyW, _ | |
"ToggleHighlight", wdKeyControl + wdKeyE, _ | |
"DobuleUnderline", wdKeyControl + wdKeyD, _ | |
"GrayOut", wdKeyControl + wdKeySemiColon, _ | |
"StrikeAndColoredToRed", wdKeyControl + wdKeyEquals, _ | |
"PasteAsLink", wdKeyControl + wdKeyL, _ | |
"*** END ***" _ | |
) | |
commandSetting = Array( _ | |
"FileSaveAs", wdKeyControl + wdKeyS, _ | |
"InsertNewComment", wdKeyControl + wdKeyK, _ | |
"*** END ***" _ | |
) | |
'------------------------------------------------------- | |
Dim i As Integer | |
For i = 0 To UBound(macroSetting) - 1 Step 2 | |
Call KeyBindings.Add(wdKeyCategoryMacro, _ | |
macroSetting(i), macroSetting(i + 1)) | |
Next | |
For i = 0 To UBound(commandSetting) - 1 Step 2 | |
Call KeyBindings.Add(wdKeyCategoryCommand, _ | |
commandSetting(i), commandSetting(i + 1)) | |
Next | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment