Handling text selected bottom to top or right to left

R

Rob Stewart

Normally, with text that is selected in a top down fashion, you can
use the Selection.MoveRight(...) method to increase or decrease the
size of the selection.

However if you select in the reverse direction, e.g. the bottom of a
paragraph to the top, using the same method treats the top of the
selection as the end, so a MoveRight() or MoveLeft() will actually
operate from the top of the selected text and expand or shrink from
there.

Is there a way of detecting that a user has selected in the reverse
direction, and either 'swap' the selection direction, or operate from
the start position (i.e. the bottom of the selection)?

I've tried detecting if Selection.Start > Selection.End, but Word
seems to automatically swap these properties, so that .Start
represents the top of the selection, and .End the bottom.

Any ideas?

Thanks,
Rob
 

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