move current cursor line to top of window

D

dodge.nathan

One time awhile back I had found a macro for positioning the curent
cursor line to the top of the window. After quite a bit of web
searching I can't seem to find it again.

Does anyone know how to accomplish this ?
 
J

Jay Freedman

One time awhile back I had found a macro for positioning the curent
cursor line to the top of the window. After quite a bit of web
searching I can't seem to find it again.

Does anyone know how to accomplish this ?

Include this line in your macro:

ActiveWindow.ScrollIntoView Selection.Range, True
 
J

Jayawanth

Dear Jay Freeman,
I had posted this question earlier. There were no replies. You may be able
to help out.

While reading through a word document, after reading down a few lines I would
like to focus on the current section. It is desirable to pull the current
line to the top of the window. Similarly make current section or paragraph
begin at the top of the window. Any simple macros to do this?

Thanks,
Jayawanth
 
J

Jayawanth

I tried the macro posted - it works only if the cursor is off the visible
window. If the cursor is in the middle of the window, it will not scroll
current line to the top.
 
J

Jay Freedman

If you can keep track of the number of lines added, you can use the
ActiveDocument.ActiveWindow.SmallScroll method to scroll the screen.
The trouble is that there's no usable way of finding out where the
Selection is with respect to the top of the window -- you can use the
Information method to get the vertical position relative to the top of
the page or the top margin, but not the visible window.
 

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