Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2006

Tip: Looking for answers? Try searching our database.

Set F12 to delete line; how?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cherri - 17 Sep 2006 13:40 GMT
I want to assign "delete line" for MS Word to the F12 key.  How can I do this?
Graham Mayor - 17 Sep 2006 14:33 GMT
What constitutes a 'line' in this context. A line is a transient thing the
length of which depends on a number of factors. How are you determining what
is on the 'line' that you wish to delete?

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> I want to assign "delete line" for MS Word to the F12 key.  How can I
> do this?
Cherri - 17 Sep 2006 17:34 GMT
Graham, thanks so much.  Example:  the second line of your post below, a
line of text ("...length of which...").

When I'm composing in MS Word, I would like to use the F12 key to delete a
line of text immediately below the line I am working on.  I guess an easier
way of describing this is I want to "suck up" unwanted text by entire line of
text, not just a character.

Does this make sense?  Sorry, I'm not technically-vocabularized.  

Thanks again for reading/responding to my post.  

Cherri

> What constitutes a 'line' in this context. A line is a transient thing the
> length of which depends on a number of factors. How are you determining what
> is on the 'line' that you wish to delete?
>
> > I want to assign "delete line" for MS Word to the F12 key.  How can I
> > do this?
Helmut Weber - 17 Sep 2006 19:21 GMT
Hi Cherri,

a million ways to delete the next line,
and a million complications.

This is just a working solution.
Handle with care!

Sub DeleteNextLine()
Dim rTmp As Range
' remember the selection
Set rTmp = selection.Range
With selection
    .GoTo _
    what:=wdGoToLine, _
    which:=wdGoToNext, _
    Count:=1
    .Bookmarks("\line").Range.Delete
End With
'restore the selection
rTmp.Select
End Sub

Hoping, assigning a shortcut to it would not be a problem.

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

Cherri - 17 Sep 2006 21:16 GMT
Helmut,

Willhandle wth care.  thanks.  

(although wish there were a simpler way to do this....:)

> Hi Cherri,
>
[quoted text clipped - 20 lines]
>
> Hoping, assigning a shortcut to it would not be a problem.
Helmut Weber - 18 Sep 2006 15:50 GMT
Hi Cherri;

>(although wish there were a simpler way to do this....:)

it is even more complicated,
as my code deletes the actual line,
if there is no next line. :-(

HTH, nevertheless

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.