How can I assign a keyboard shortcut to delete just one line of text in Microsoft Office Word 2010?
A macro based solution (in Visual Basic) which could be assigned to a custom keyboard shortcut would be good too.
Some similar examples:
- in Notepad++ I can delete (cut) the entire current line with Ctrl+L
- in NetBeans, I can delete an entire line with Ctrl+E
- in Eclipse, I can delete current line with Ctrl+D
- etc.
Best Answer
Macro-based shortcut
OK, based on our comment discussion here's a macro based solution.
Create a new Macro with the following code (Alt+F8, specify the name, click Create):
Assign a keyboard shortcut to it:
And you are done. Now you can press Ctrl+D whenever your cursor is on a line and it will perform Home - Shift+End - Delete sequence for you which will delete the line.
Hopefully, that will work for you. Cheers!