PDA

View Full Version : [SOLVED:] How to check if Outlook is the focused window



davidman
01-08-2015, 11:15 AM
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?

davidman
01-08-2015, 03:43 PM
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