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
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