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

    Hopeful question (VBA Word 2007)

    I didn't quite know how to come up with a good subject line.

    I've got a Word application done in VBA. Unfortunately, it's running on a virtual machine in our Operations center.

    It runs fine, except when the operator tries to use the mouse or keyboard to access another app causing the Word app to lose the focus.

    I know it's dangerous, but is there a way to disable the mouse and keyboard while the app is running? The Operations operators have been told not to touch the mouse or keyboard while the process is running, but you know how that goes...

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

    Re: Hopeful question (VBA Word 2007)

    Wouldn't it be better to try to find out why it's a problem if Word loses focus? Perhaps you could program around that.

  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: Hopeful question (VBA Word 2007)

    I agree with Hans.

    (In 16-bit Windows, you could call SetSysModalWindow to lock the UI and prevent users from switching applications. That function was deleted in 32-bit Windows, and I don't know whether there is any replacement.)

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

    Re: Hopeful question (VBA Word 2007)

    I agree - bad idea. I've added code 'documents(docname).Activate' throughout the appropriate places. We'll see what that does. Word seem to get a bit confused whever the mouse moves out of the active VM virtual machine window.

Posting Permissions

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