"extend" in cell

E

Ed

By a find and replace, I have placed the cursor on a certain letter within
text in a cell in a standard table.

Now, I want to move the selection one character to the right.

When I use this command

Selection.MoveRight Extend:=wdExtend

to move the selection to the right, it selects all content from the
beginning of the cell. How do I prevent the selection from moving "left" and
"up" in a cell when all I want is a move one character to the right?

Thanks.
Ed
 
E

Ed

You need to specify a unit and a count.
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend

Here's a tip I have used well: when you're coding, if you get stuck on a
command, proprty, or method, click in the word and press F1. It will bring
up the Help topic for that word.

HTH
(Arizona) Ed
 
E

Ed

I am sorry that I wasn't more careful in my original post, but my
"Selection.MoveRight" command was fully 'argued' in my code. The full
command line did read "Selection.MoveRight Unit:=wdCharacter, Count:=1,
Extend:=wdExtend", and the error I reported in my first posting occured
despite the proper, full, code being provided. If you try to extend a
selection in a cell using that code, the whole cell is selected (including
all text and markers to the left of the StartAt point. It is contrary to the
request I have made. Why is it happening and what can I do to prevent it
from happening?

Sorry for the inconvenience.

Ed (Virginia)


============
 
E

Ed

Ed (V): Sorry about the "newbie" assumption, but I know I needed a lot of
the "Captain Obvious" when I was first starting.

I just cycled
Selection.MoveRight wdCharacter, 1, wdExtend
through an entire table cell. It moved the selection one and only one
character at a time - until it hit the last text character. At that point,
the code did indeed highlight the entire cell, marker and all. I'm using
Word 2000, so I hope our versions are compatible. Is this the behavior
you're seeing?

Ed (A)
PS - I've only got about another 30 minutes here, then I'll be off until
tomorrow. Hate to leave you hanging, although I would also hope some of the
*real* experts come onto this as well.
 
E

Ed

I found the problem. Maybe it will be of use to others.

If in extending one character you happen to pick up the "end of cell" marker
(apparently asc #7), Word selects the whole cell. That's what I was doing.

Ed (Virginia)

======================
 

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