text select in table

E

ebct

Hello. If I have a line of text in a document, place the cursor in the
middle of the line, and hit shift-end, it selects the text from the
cursor to the end of the line, leaving unselected the text before the
cursor. If I do the same thing inside a table cell, it always selects
all the text in the cell which isn't what I want. Is there a way to
make it stop doing that?

Thanks,
Irwin
 
D

Doug Robbins - Word MVP

Shift+End, selects everything to the end of the line. In the case of a
single line, or the last line, of text in the cell of a table, "everything"
includes the end of cell marker, and including that marker in the selection
causes the whole cell to be selected.

I realise that it is not what you want, but that is the way it works. The
only way around it is to use the mouse to do the selecting.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
E

ebct

Thanks. I wonder why it has to work this way. The real problem is that
I was trying to write a VBA script to do this, in which case using the
mouse won't work. I could try to figure out how to extend to the end-1,
but I don't know how to do that yet. If you know, I would love a tip,
otherwise I will just keep struggling with it until I get it.

Thanks,
Irwin
 
E

ebct

Actually, that does work. I was thinking it would lose where the cursor
sat in the text, but if one selects to the end and then uses the left
arrow key, you get what you want. A VBA script can do that, so I have
what I need. Thanks,

IMF
 
D

Doug Robbins - Word MVP

This is one way to do it using vba

Dim myrange As Range
Set myrange = Selection.Cells(1).Range
myrange.End = myrange.End - 1
myrange.Start = Selection.Range.Start
myrange.Select

But, if you do not need to select it, don't. myrange.Text will return the
text that would have been selected, so you for instance, insert that text in
another location by using

[object].InsertBefore myrange.Text

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top