Consulting

Results 1 to 2 of 2

Thread: How to check if Outlook is the focused window

  1. #1

    How to check if Outlook is the focused window

    Hi

    I want to run a sub to force all my rules to run if Outlook is not the active window, is there a way to see what program the focused window is?

  2. #2
    Found it, it won't let me post the URL for it but I took it from techrepublic.com, an article called 10 of my favourite api functions

    Private Declare Function GetActiveWindow Lib "user32" () As Long
    Function apicGetActiveWindow()  'Return window handle of active window.  
    Dim lngWindow As Long  
    apicGetActiveWindow = GetActiveWindow()
    End Function

Posting Permissions

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