P
Peter Ostermann
Hi NG,
as everybody knows minimizing Outlook 2007 creates a little Icon in the
system-tray, and it is recommendable to minimize it, every time after usage,
because it takes a while to start Outlook again after closed.
The user nevertheless often falls victim his habit, to close applications
after usage. I try to show a prompt before closing to stop "Quit", but once
the Quit event is released it seems that it can't be stopped anymore, even
though the prompt still happens.
Here the code:
Private Sub Application_Quit()
OK = MsgBox("Really want to quit?", vbYesNo, "Closing Outlook")
If OK <> 6 _
Then
OK = MsgBox("Quit stopped, minimized", vbYes, "Closing Outlook")
Call MinimizeActiveWindow
End If
OK = MsgBox("Test completed", vbYes, "Closing Outlook")
MsgBox "Goodbye, " & Application.GetNamespace("MAPI").CurrentUser
End Sub
Sub MinimizeActiveWindow()
OK = MsgBox("There is no window anymore that could be minimized", vbYes,
"Closing Outlook")
ActiveWindow.WindowState = olMinimized
End Sub
How would a "Quit-stop" look like to solve this problem?
Regards
Peter Ostermann
as everybody knows minimizing Outlook 2007 creates a little Icon in the
system-tray, and it is recommendable to minimize it, every time after usage,
because it takes a while to start Outlook again after closed.
The user nevertheless often falls victim his habit, to close applications
after usage. I try to show a prompt before closing to stop "Quit", but once
the Quit event is released it seems that it can't be stopped anymore, even
though the prompt still happens.
Here the code:
Private Sub Application_Quit()
OK = MsgBox("Really want to quit?", vbYesNo, "Closing Outlook")
If OK <> 6 _
Then
OK = MsgBox("Quit stopped, minimized", vbYes, "Closing Outlook")
Call MinimizeActiveWindow
End If
OK = MsgBox("Test completed", vbYes, "Closing Outlook")
MsgBox "Goodbye, " & Application.GetNamespace("MAPI").CurrentUser
End Sub
Sub MinimizeActiveWindow()
OK = MsgBox("There is no window anymore that could be minimized", vbYes,
"Closing Outlook")
ActiveWindow.WindowState = olMinimized
End Sub
How would a "Quit-stop" look like to solve this problem?
Regards
Peter Ostermann