Create msgbox to confirm before Outlook closes

zoso

Well-known Member
Joined
Oct 23, 2003
Messages
725
Hi there!

I have the following code:
Code:
Private Sub Application_Quit()
    Dim Response As Integer
    Dim Title As String
    Dim Message As String

   Title = "Confirm"
   Message = "Do you really want to quit Outlook?"
   Response = MsgBox(Message, vbYesNo, Title)
   If Response = vbNo Then
       ???????????????
   End If
End Sub
What I'm after is some code in place of the ???????? so that Outlook remains open.

Hope you can help - and thanks!
 
Sorry, I thought you understood from one of my earlier posts when I did this ..

firefytr said:
In ThisOutlookSession paste:


<font face=Tahoma New><SPAN style="color:#00007F">Option</SPAN> <SPAN style="color:#00007F">Explicit</SPAN>

<SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Application_Startup()

<SPAN style="color:#00007F">Call</SPAN> DisableExit
<SPAN style="color:#00007F">Call</SPAN> CreateMenu

<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

But you did get it working, beautiful. :)
 
Upvote 0

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,213,551
Messages
6,114,267
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top