PDA

View Full Version : Centering a selection in the window



smallken
10-02-2011, 12:29 AM
When I select a shape with the code pRange.ShapeRange(1).Select the selection is at best at the bottom of the window and often not in the window at all, requiring me to scroll down to see it.

Does anyone have any code that centers the selection in the window. If the shape is too large for the window then the top of the shape should be at the top of the window. It should work no matter whether the shape is anchored to a paragraph or the page.

gmaxey
10-02-2011, 01:51 PM
Try:
Application.ActiveWindow.ScrollIntoView Selection.Range

smallken
10-02-2011, 02:09 PM
Thanks gmaxey