Make Access the active app

M

macroapa

HI,

I have some code that control MSOutlook and therefore Access no-longer
is the active app.

I was expecting to be able to use the code Application.Activate to get
Access back, but this doesn;t seem to exist for access.

Does anyone know the Access equiv for Application.Activate?

Thanks.
 
P

Paul Shapiro

You can use a Windows API.

Private Declare Function apiSetForegroundWindow Lib "user32" Alias _
"SetForegroundWindow" (ByVal hWnd As Long) As Long

Call pjs_apiSetForegroundWindow(hWnd:=Application.hWndAccessApp)
 
Top