Page scroll when you reach the bottom line - how?

I have a VBA macro in Word that goes through a document word by word and applies formatting as needed. When it reaches the bottom line of the screen, it scrolls one line and repaints the screen. I'd prefer to do Page Down so that the screen won't repaint every single line - it looks very jerky.

It looks like ActiveDocument.ActiveWindow.LargeScroll would do the job, but I don't see a way to know the current selection is at the bottom line of the window.

How might I do this?


Thanks -

Chuck

Comments

  • : I have a VBA macro in Word that goes through a document word by word and applies formatting as needed. When it reaches the bottom line of the screen, it scrolls one line and repaints the screen. I'd prefer to do Page Down so that the screen won't repaint every single line - it looks very jerky.
    :
    : It looks like ActiveDocument.ActiveWindow.LargeScroll would do the job, but I don't see a way to know the current selection is at the bottom line of the window.
    :
    : How might I do this?
    :
    :
    : Thanks -
    :
    : Chuck
    :
    So, Word don't care about every lines too much. It cares about paragraphs and this is problem. At least in this case ;). For example, you can test
    ActiveWindow.ActivePane.VerticalPercentScrolled
    after every step of your macro (after every paragraph etc.) and if it has changed, do LargeSchroll

    [code]Dim OldValue As Long
    OldValue = ActiveWindow.ActivePane.VerticalPercentScrolled
    Do
    [green]'Some formatting [/green]
    If OldValue <> ActiveWindow.ActivePane.VerticalPercentScrolled Then
    ActiveDocument.ActiveWindow.LargeScroll
    OldValue = ActiveWindow.ActivePane.VerticalPercentScrolled
    End If
    Loop...[/code]
    And it should look like this:
    Your macro will do some stuff. When it moves to the last line and schroll the window (like it do now), the Vert%Schrolled property should be changed and you will do LargeSchroll...

    But I'm not sure what will happen when you have LARGE documents. There the percentage change won't be so effective ;)

    PavlinII


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion