B
Ben Bullock
Greetings,
I want to get an Emacs-like Control-K in Word. This means a function
to delete ("kill") everything from the cursor position to the end of
the current line.
There is a partial solution here:
http://www.macosxhints.com/article.php?story=20070215034801484
but it needs some improvement.
So far I have this:
--------------------
Sub EmacsControlK()
'
' EmacsControlK Macro
'
'
If Selection.Information(wdWithInTable) Then
MsgBox ("disabled in tables")
Else
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Cut
End If
End Sub
-----------------
It works OK on lines, although it is not quite perfect, but inside
table cells, for some reason, if it is on the last line of multiline
text, or if there is only one line in the cell, it deletes everything
in the cell, including everything before the cursor (even multiple
lines of content) - something I don't want. I have googled somewhat
and tried to do various things, but every effort seems to send me back
to the debugger.
Thanks for any wild guesses or ideas.
I want to get an Emacs-like Control-K in Word. This means a function
to delete ("kill") everything from the cursor position to the end of
the current line.
There is a partial solution here:
http://www.macosxhints.com/article.php?story=20070215034801484
but it needs some improvement.
So far I have this:
--------------------
Sub EmacsControlK()
'
' EmacsControlK Macro
'
'
If Selection.Information(wdWithInTable) Then
MsgBox ("disabled in tables")
Else
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Cut
End If
End Sub
-----------------
It works OK on lines, although it is not quite perfect, but inside
table cells, for some reason, if it is on the last line of multiline
text, or if there is only one line in the cell, it deletes everything
in the cell, including everything before the cursor (even multiple
lines of content) - something I don't want. I have googled somewhat
and tried to do various things, but every effort seems to send me back
to the debugger.
Thanks for any wild guesses or ideas.