We help IT Professionals succeed at work.

MS Word 2010 VBA - How to delete a line of text

brothertruffle880
on
I need a MS word macro which does the following:

1. Brings the blinking cursor to the left side of the line of text (i.e. beginning of the line.)  The cursor could be anywhere in the middle of a line of text.
2. Select all the text on that line (including the hard return symbol).
3. Delete the entire line of text.
Comment
Watch Question

See if this is what you are looking for:

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

Paul