scroll window to a range

P

Pablo Cardellino

Hi,

I need to scroll the windowpane where I'm working positioning the to
left corner of the line where a given range begins at it top left corner.

Aditionally, I would need to verify if the bottom of the last line in
the same range is visible in the screen, and if not, to zoom the window
pane until the whole range is visible.

I was looking for the ActiveWindow.ActivePane properties but I couldn't
find anything to handle this.

Can anyone help me?

Thanks in advance.

Pablo Cardellino
 
D

Doug Robbins - Word MVP

To get the start of the range at the top left of the screen, you can use the
Window.ScrollIntoView Method. To determine if the whole of the range is
visible, you can use the Window.GetPoint Method, which will return an error
if it is not. By trapping that error, you should then be able to adjust the
zooming of the window by using
ActiveDocument.ActiveWindow.View.Zoom.Percentage = [some number] , in a loop
that reduces the zoom.percentage until the error no longer occurs.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
P

Pablo Cardellino

Hi, Doug

that was just I needed, thanks a lot!

Regards,

Pablo Cardellino

El 17/5/2010 03:44, Doug Robbins - Word MVP escribió:
 

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