PDA

View Full Version : Solved: Position of the insertion point within the active window



marcelma
11-22-2010, 10:13 AM
Hello,

is there any possibility to find out "where" in the active window the insertion point is presently located (i.e. is it close to the top of the screen or close to the bottom)?

Before asking the user a question in a message box I would like to position the selection in the middle of the active window, so that the whole context around the selection is visible and can be consulted when deciding on an answer.

Thanks a lot in advance,
Marcel

marcelma
11-24-2010, 04:26 AM
Hi - for everybody who happens to have an interest in a solution: This is what I have come up with:

ActiveWindow.ActivePane.LargeScroll Down:=-2
ActiveWindow.ScrollIntoView Selection.Range, True


The 1st line scrolls the insertion point / selection out of sight, the 2nd line brings it into sight again in a standardized position. This position is not exactly the middle of the pane but in sufficient distance from the top to see the the selection in context