Results 1 to 4 of 4
  1. #1
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Restoring focus to footer (Word 2002 SP-2)

    I'm hoping there's a relatively simple answer to this question, but darned if I can figure it out.

    Suppose the IP is on page 17 of Section 2 of the main document. Meanwhile I've gone into View Header and Footer mode and navigated to the Section 4 footer. Now I'm going to run a macro that will be moving to the main document (SeekView = wdSeekMainDocument) and doing something or other (and perhaps even editing one or more of the other footers). When the macro is finished, I'd like to (1) leave the IP in the main document unchanged (either the above-mentioned point on page 17 of Section 2, or wherever the macro left it if the macro fiddled with the main document's IP) and (2) put me back in the Section 4 footer (as if I'd never left).

    I've been successful at initially setting a range in the Section 4 footer and selecting it at the end of the macro, but the view is still lacking. I can switch back to Header and Footer view (e.g., with SeekView = wdSeekCurrentPageFooter), but can't figure out how to end up looking at the Section 4 footer.

  2. #2
    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: Restoring focus to footer (Word 2002 SP-2)

    Limited 'cause I'm writing this from my phone... how about selecting the range and using Scrollintoview? See <post#=271032>post 271032</post#>.

  3. #3
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Restoring focus to footer (Word 2002 SP-2)

    Thanks for pointing me to ScrollIntoView, which I may find uses for in the future. However, I haven't been able to get it and footers to play together. If I use it to try to scroll to the initial range I set in the Section 4 footer, it scrolls me to Section 4 in the main document (and with the top of the section at the top of the screen -- so far so good), but then I can't seem to get from there into the Section 4 footer. I tried using RangeFromPoint to reset the main document selection to Section 4 after the scroll -- Set oRng = ActiveWindow.RangeFromPoint(0, 0), followed by oRng.Select -- before switching to Print view and using .SeekView = wdSeekCurrentPageFooter, but that didn't give me the desired result.

  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: Restoring focus to footer (Word 2002 SP-2)

    > .SeekView = wdSeekCurrentPageFooter

    I think Word interprets "current page" to be the page on which the insertion point can be found, not the contents of the ActiveWindow. If you can't move the selection, we need to find another way to open the footer. After groping around in the object model, there doesn't appear to be any (other) direct route.

Posting Permissions

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