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

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,215,054
Messages
6,122,897
Members
449,097
Latest member
dbomb1414

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