Delete Whole Line in Word for Mac: Assistance Required

Hi all,

I'm very new to KM, so please forgive me if I'm doing something wrong, and it is very simple.

I have to use Word for work, notwithstanding that I loath it. One of the things that annoy me in Word for Mac is that command+backspace deletes the last word, and not the whole line, as with elsewhere on MacOS.

I have tried to write a macro to correct this. As below:

Shift, command left arrow selects the whole line. Delete should then delete it. But when I press command+backspace it only completes the first half of the macro (selecting the line) and doesn't delete it.

I assume I'm doing something wrong.

Can someone help?

Thanks so much

Hi @DIYerUK,
I tried your macro on my Mac and it works fine!

It may be a timing issue though so I'd suggest putting a short delay in between the two actions like this:
KM 0 2021-05-27_18-42-15

Let us know if that works!

2 Likes

Yes!

That worked. Thank you!

Just for my own learning, and only if you have time, would you be able to explain to me why that helped and sorted out the problem?

Thanks again! Really appreciate it.

1 Like

No problem - KM can “type” much faster than any of us - sometimes quicker than your Mac can keep up with. So putting that delay in gives your poor old Mac a chance to catch up!

(At least that’s what I think is going on) :wink:

1 Like

Thanks so much. Really appreciate it.

1 Like

Hey Guys,

I didn't require a delay for this to work on my old 2010 MacBook Pro with Word 16.16.10.

Word ⇢ Delete Line.kmmacros (2.7 KB)

Alternatively you can record a macro for Word and assign it a hotkey within Word.

Sub Delete_Line()
'
' Delete_Line Macro
' test
'
    Selection.HomeKey Unit:=wdLine
    Selection.EndKey Unit:=wdLine, Extend:=wdExtend
    Selection.Delete Unit:=wdCharacter, Count:=1
End Sub

-Chris

Thanks very much for the reply. I basically used the first macro, but added a delay of 0.005 seconds, and it works a treat.