Home > OS >  Mapping Keyboard Shortcuts in Word (vba) KeyBindings.Add KeyCategory: = wdKeyCategoryCommand, Comman
Mapping Keyboard Shortcuts in Word (vba) KeyBindings.Add KeyCategory: = wdKeyCategoryCommand, Comman

Time:01-13

Good day.

Someone has a list of the commands that can be assigned a keyboard shortcut using the function:

KeyBindings.Add KeyCategory: = wdKeyCategoryCommand, Command: = "..."

I want to assign a shortcut to decreasing French indentation, but I only see the command for its increase: Command: = "HangingIndent"

Thank you. Greetings.

CodePudding user response:

Choose Developer>Macros. Change the Macros in dropdown to Word commands. The complete list of available command names is displayed.

If you need to set specific indentation amounts, you'll have to write a simple macro instead of relying on Word's preset indentation values.

But it's probably better to avoid VBA altogether. Instead of relying on local formatting (which a Word command or macro would do), create a typestyle with your preferred indentation and apply that to the text. That's a better practice in Word and easy to update later if you change your mind about the amount of indentation.

CodePudding user response:

The problem is precisely that, that the command related to the decrease of the French indentation does not appear in the list of Word commands. What I need to know is what the said command is called. After a lot of thinking I found a command to list all the keyboard shortcuts in the active document: Application.Run MacroName: =" CommandList" and this allowed me to find what I'm looking for: RemoveHangingIndent

  •  Tags:  
  • Related