Distinguishing between collapsed selection and single highlighed letter

E

Ed

When the cursor is 'collapsed' next to a character (let's say the letter
"A"), the following values are returned:

Selection.text = "A"
Len(Selection) = 1

When the cursor is "expanded" across the same character, the exact same
values are returned.

How can one distinguish in VBA between a single highlighted letter and just
a collapsed cursor to the left of that letter.

Thanks. -Ed (in Virginia)
 
T

Tony Jollans

There are various ways. I suppose the 'correct' one is Selection.Type. This
will give wdSelectionIP for a collapsed Selection and wdSelectionNormal for
an "expanded" one. Do be aware, however, that there are other values if, for
example a shape is selected.
 
E

Ed

That's the ticket!. Thanks. I thought type meant "type text" but I see a
different command for that.)

--Ed
 

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