[Word | VBA] 自定义快捷键 | 选中当前行 | 删除当前行

如何定制?只需:

1)在word通过下面的VBA创建宏。

2)为创建的宏指定快捷键。

使用到的VBA代码:

删除当前行

Sub deleteCurrentLine()
    Selection.HomeKey Unit:=wdLine
    Selection.EndKey Unit:=wdLine, Extend:=wdExtend
    Selection.delete Unit:=wdCharacter, Count:=1
End Sub

选中当前行

Sub selectCurrentLine()
    Selection.HomeKey Unit:=wdLine
    Selection.EndKey Unit:=wdLine, Extend:=wdExtend
End Sub

 

如何将宏指定为快捷键,请参考:https://zhidao.baidu.com/question/499060134892652604.html

如何打开VBA窗口,请参考:https://support.office.com/zh-cn/article/%E5%88%9B%E5%BB%BA%E6%88%96%E8%BF%90%E8%A1%8C%E5%AE%8F-c6b99036-905c-49a6-818a-dfb98b7c3c9c

[顺带一提]

1.当前行/选中部分的格式去除:Ctrl+shift+N

2.导航侧边栏快捷键设置:请参考https://zhidao.baidu.com/question/428567958624530892.html

你可能感兴趣的:(vba,word)