Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    London, Gtr London, England
    Posts
    100
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Keeping line being entered to center of screen (Word 2000)

    Anyone know if you can/how you would set things up so that that the line of text you are typing up is always at the mid point up/down the blank part of the screen.

    Will

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Keeping line being entered to center of screen (Word 2000)

    That kinda sounds like the effect scroll lock is supposed to produce. But it doesn't.

    I bet you could write a macro that would do it.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Keeping line being entered to center of screen (Word 2000)

    Hi Will,

    If I understand what you're trying to do correctly:
    File > Page Setup > Page setup > Vertical alignment=Centered.

    This setting is on a per-section basis; so if you want another part of the document top-aligned, you'll have to insert a section break.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Keeping line being entered to center of screen (Word 2000)

    Word offers a method called ActiveWindow.ScrollIntoView(object, start) which lets you bring an off-screen insertion point to the top (start parameter True) or bottom (start parameter False) of the screen, typically to the top. This could be useful if you had used the scrollbar to view a different part of the document and now wanted to find your place again quickly. You also can use it to scroll to another kind of object (e.g., a picture) somewhere else in the document.

    In Word 2000, ScrollIntoView doesn't have a "middle of the screen" option. Therefore, I think the macro to do this would have to do a lot of math. (That is, you could use the ActiveWindow.SmallScroll(Down, Up) method, but figuring out the number of lines to move up or down would be a bit of work.)

  5. #5
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Keeping line being entered to center of screen (Word 2000)

    Sorry, didn't "get" the original question: I misread "page" for "screen".

    .ScrollIntoView doesn't work as advertised for me (The "start" parameter = True/False doesn't seem to have a great -- or at least predictable -- influence, so it seems hopeless to get exact control).

    Something like this seems to work:

    Application.ScreenUpdating = False
    ActiveWindow.VerticalPercentScrolled = 0
    ActiveWindow.ScrollIntoView Selection.Range, True
    Application.ScreenUpdating = True

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  6. #6
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    London, Gtr London, England
    Posts
    100
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Keeping line being entered to center of screen (Word 2000)

    Thanks for the time you've given on this. I'm being dumb here. The command
    ActiveWindow.ScrollIntoView(object, start)
    is found where?

    I have created a macro using Klaus's suggested wording. It works in that Word does not point to any errors and require me to debug, but the macro I created doesn't do anything. Would you please explain about the ActiveWindow command, please? The help feature in Word or VBA doesn't mention it.

    Will



    Word offers a method called ActiveWindow.ScrollIntoView(object, start) which lets you bring an off-screen insertion point to the top (start parameter True) or bottom (start parameter False) of the screen, typically to the top. This could be useful if you had used the scrollbar to view a different part of the document and now wanted to find your place again quickly. You also can use it to scroll to another kind of object (e.g., a picture) somewhere else in the document.

    In Word 2000, ScrollIntoView doesn't have a "middle of the screen" option. Therefore, I think the macro to do this would have to do a lot of math. (That is, you could use the ActiveWindow.SmallScroll(Down, Up) method, but figuring out the number of lines to move up or down would be a bit of work.)

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Keeping line being entered to center of screen (Word 2000)

    I'll explain how I got there and, because it's Saturday and I feel lazy, I'll point you to the online help screens you need.

    In the VB Editor, I pressed F2 and did a search for scroll. I then reviewed the list for all the different scrolling methods, highlighted the ones that sounded interesting, and pressed F1 to read the online help on them. If this doesn't give you any help, you might need to fire up the Office Installer again and install all the VBA help files.

    ActiveWindow is a not a command, it's a shorthand reference to the document window that has "the focus." That's usually the front-most Word window, but it could be behind something else, like the VB Editor window. When you type ActiveWindow and then press period, VB pops up a list of the properties and methods that you can use to operate on that window. This is a different set of properties and objects than you would get if you started with ActiveDocument. A Document object is a bunch of text, while a Window object is a kind of viewer... okay, I'll stop the academic digression, but here's the point: sometimes, you need to try the other one if the one you're exploring doesn't have any useful properties or methods.

    Now, my impression is that ScrollIntoView is useful to get the insertion point onto the visible part of the document window, but not to position it precisely. What's Klaus' code does is this: [b]ActiveWindow.VerticalPercentScrolled

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •