Re-open Word document to previous cursor location with identical page vertical position
- by Malcolm
I would like to return to my previous point of edit with the page vertically positioned identical to its original vertical position. The Shift+F5 technique returns me to the previous point of edit, but the page I return to is vertically positioned on the screen in a somewhat random manner. In other words, if my cursor is 300 vertical pixels from the top of the document viewport, I would like to re-open my page so that the location of the cursor is still 300 vertical pixels from the top of my viewport.
The following can be used to determine the vertical position (on the screen) of my text cursor:
ActiveWindow.GetPoint pLeft, pTop, pWidth, pHeight, Selection.Range
So the challenge becomes how to scroll my document in such a manner as to return my text cursor to its original vertical position (pHeight)?
There is no corresponding ActiveWindow.SetPoint and ActiveWindow.ScrollIntoView scrolls a selection range into view, but offers no control over the vertical position of the selection range on the screen.