Retrieve selection start index

Good day,

1) I am registering the event Document.Selection.Target.Changed. Even though i can access the selected text through Document.Selection.Target, i could not find a way to retrieve the start index of the selection (such as the native WinForms TextBox.SelectionStart). There may be a solution by using user32.dll or the Windows Automation API but it would be prefferable if i could avoid that.

2) I noticed that when a selection is made in the Editor, the ActiveSegment does not change. Is there a way to manualy set the ActiveSegment to the one that is being highlighted (possibly through Document.SetActiveSegmentPair) from the aforementioned event's context? The problem is that there is no property to reference the SegmentPair that is being highlighted so i can retrieve its id.

Thank you in advance,

George Evgeneiadis

Parents Reply Children