Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    York, Pennsylvania, USA
    Posts
    164
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Activating Word in Windows (VBA/Word XP)

    I can't seem to find a way to make Word active over any other application which has the focus in Windows.

    I've got a VBA application that builds a document and pops up the File/SaveAs box when done. The user, in the interim, may have gone back to another application. Word flashes the taskbar when the box is presented, but the user has to click in the Word task to re-activate Word. Is it possible to give the application focus back to Word? I've tried Application.Activate with a few variants without any luck. Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Activating Word in Windows (VBA/Word XP)

    Are you using Windows XP? By default, it doesn't allow other apps to "steal the focus". If you have TweakUI, you can change this - see screenshot. TweakUI can be downloaded from the Microsoft website.

  3. #3
    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: Activating Word in Windows (VBA/Word XP)

    While I can appreciate that your procedure needs to finish its task, the user might be doing something that it would be rude to interrupt. Perhaps there is an API call that can make a window appear "on top" of everything else saying, "Hello, come back to Word now" without forcibly pushing Word to the front. Just a thought.

  4. #4
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    York, Pennsylvania, USA
    Posts
    164
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Re: Activating Word in Windows (VBA/Word XP)

    Thanks, folks. It's running in a Win2K environment. Since it's a priority production program/system there's no problem in forcing the active app back to Word. I implemented a call through the API which bonks them back to Word at the appropriate time after the post. Just wish straight Word VBA would have sufficed.

Posting Permissions

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