I want to capture the backspace event, just do the backspace's action, then add other action, but I am not sure the backspace's original action:Selection. Delete , -1 ?
Sub AddKeyBinding()
With Application
' \ Do customization in THIS document
.CustomizationContext = ThisDocument
' \ Add keybinding to this document Shorcut: Backspace
.KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyBackspace), _
KeyCategory:=wdKeyCategoryCommand, Command:="TestKeybinding"
End With
End Sub
' \ Test sub for keybinding
Sub TestKeybinding()
Selection.Delete , -1 ' I am not sure how to impl the original command
If Selection.Style = "Some...Style" And Selection.Range.ListFormat.ListString = "" Then
Selection.Style = "DefaultStyle"
End If
End Sub
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…