Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Feb 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Screen Updating Not Working (Word 2000 9.9.3821 SR-1)

    I have written a macro that collects data from one Word document, displays a userform (dialog box), then opens another document and revises it based on the information collected from the first document and the choices made by the user in the dialog box. The macro works fine, except that when it ends the first document is still displayed on the screen, but it doesn't have focus (keypresses do nothing). However, if I access a menu item by alt-key or mouse click, the second document is displayed (which is what I want). Screen Updating and/or Refreshing does not work. Any suggestions on how to display the second document (the one the macro opens)? Thanks.

  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: Screen Updating Not Working (Word 2000 9.9.3821 SR-1)

    TweakUI's "don't steal focus" (or something like that) setting can cause issues. Perhaps a good workaround is to minimize the first window when you're done using it so that it can't get in the way. Does that work?

  3. #3
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Screen Updating Not Working (Word 2000 9.9.3821 SR-1)

    If Doc.Activate doesn't do the trick, then often it helps when you switch to another view and back for the second document. Assuming you're in Page view:

    Dim Doc2 As Document
    Documents.Add
    Set Doc2 = ActiveDocument
    ' ..........
    ' Your code
    ' ..........
    Doc2.Activate
    ' If this doesn't work, try:
    Doc2.ActiveWindow.View.Type = wdNormalView
    Doc2.ActiveWindow.View.Type = wdPageView
    ' ..........

Posting Permissions

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