Bonjour
J'ai une base Lotus qui affiche un document Word. Puis je ferme le handle de ce document.
Set WApp = object.Activate ( True )
WApp.Save
Set WApp = object.Activate ( False )
Set WApp = Nothing
Set object = Nothing
Malhereusement l'application Word est alors ramenée au premier plan sans la fermer, je voudrais pouvoir mettre en premier plan Lotus Notes.
J'ai essayé : Activateapp "Notes"
Mais cela affiche un message d'erreur "Illegal function call".
J'ai alors essayé de bout de code :
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Any, ByVal lpWindowName As Any) As Long
Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdSHow As Long) As Long
Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
hWin = FindWindow("SWT_Window0", &H0)
If hWin = 0 then
hWin = FindWindow("NOTES", &H0)
End if
If hWin > 0 Then
Call ShowWindow(hWin, 3)
Call SetForegroundWindow(hWin)
End if
Mais cela ne "fait" rien du tout.
Cordialement.
Partager